Skip to content

Commit

Permalink
test decouple_domain
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushikcfd committed Feb 21, 2023
1 parent 01801e2 commit e2873d4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/test_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -1627,6 +1627,25 @@ def test_concatenate_arrays(ctx_factory):
lp.auto_test_vs_ref(ref_t_unit, ctx, t_unit)


def test_decouple_domain(ctx_factory):
ctx = ctx_factory()
t_unit = lp.make_kernel(
"{[i,j]: 0<=i, j<10}",
"""
x[i] = i
y[j] = 2*j
""",
name="foo",
)
ref_t_unit = t_unit
t_unit = lp.decouple_domain(t_unit, {"j"}, set())
assert (ref_t_unit["foo"].get_home_domain_index("i")
== ref_t_unit["foo"].get_home_domain_index("j"))
assert (t_unit["foo"].get_home_domain_index("i")
!= t_unit["foo"].get_home_domain_index("j"))
lp.auto_test_vs_ref(ref_t_unit, ctx, t_unit)


if __name__ == "__main__":
if len(sys.argv) > 1:
exec(sys.argv[1])
Expand Down

0 comments on commit e2873d4

Please sign in to comment.