Skip to content

Commit 40d1906

Browse files
committed
Test decouple_domain.
1 parent 5c59153 commit 40d1906

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
@@ -1743,6 +1743,25 @@ def test_duplicate_iname_not_read_only_nested(ctx_factory: cl.CtxFactory):
17431743
lp.auto_test_vs_ref(ref_t_unit, ctx, t_unit)
17441744

17451745

1746+
def test_decouple_domain(ctx_factory):
1747+
ctx = ctx_factory()
1748+
t_unit = lp.make_kernel(
1749+
"{[i,j]: 0<=i, j<10}",
1750+
"""
1751+
x[i] = i
1752+
y[j] = 2*j
1753+
""",
1754+
name="foo",
1755+
)
1756+
ref_t_unit = t_unit
1757+
t_unit = lp.decouple_domain(t_unit, {"j"}, set())
1758+
assert (ref_t_unit["foo"].get_home_domain_index("i")
1759+
== ref_t_unit["foo"].get_home_domain_index("j"))
1760+
assert (t_unit["foo"].get_home_domain_index("i")
1761+
!= t_unit["foo"].get_home_domain_index("j"))
1762+
lp.auto_test_vs_ref(ref_t_unit, ctx, t_unit)
1763+
1764+
17461765
if __name__ == "__main__":
17471766
import sys
17481767
if len(sys.argv) > 1:

0 commit comments

Comments
 (0)