From e2873d4dede289ee59ac4f6279404adb0e5a6aba Mon Sep 17 00:00:00 2001 From: Kaushik Kulkarni Date: Tue, 21 Feb 2023 01:18:31 -0600 Subject: [PATCH] test decouple_domain --- test/test_transform.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/test_transform.py b/test/test_transform.py index 1b62f31d9..c630fb573 100644 --- a/test/test_transform.py +++ b/test/test_transform.py @@ -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])