Skip to content

Commit 514bcf7

Browse files
committed
test decouple_domain
1 parent cd90cfc commit 514bcf7

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/test_transform.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1627,6 +1627,25 @@ def test_concatenate_arrays(ctx_factory):
16271627
lp.auto_test_vs_ref(ref_t_unit, ctx, t_unit)
16281628

16291629

1630+
def test_decouple_domain(ctx_factory):
1631+
ctx = ctx_factory()
1632+
t_unit = lp.make_kernel(
1633+
"{[i,j]: 0<=i, j<10}",
1634+
"""
1635+
x[i] = i
1636+
y[j] = 2*j
1637+
""",
1638+
name="foo",
1639+
)
1640+
ref_t_unit = t_unit
1641+
t_unit = lp.decouple_domain(t_unit, {"j"}, set())
1642+
assert (ref_t_unit["foo"].get_home_domain_index("i")
1643+
== ref_t_unit["foo"].get_home_domain_index("j"))
1644+
assert (t_unit["foo"].get_home_domain_index("i")
1645+
!= t_unit["foo"].get_home_domain_index("j"))
1646+
lp.auto_test_vs_ref(ref_t_unit, ctx, t_unit)
1647+
1648+
16301649
if __name__ == "__main__":
16311650
if len(sys.argv) > 1:
16321651
exec(sys.argv[1])

0 commit comments

Comments
 (0)