From 46c2e94dc6ea0724180f44272241eb514faef51b Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Tue, 10 May 2016 11:10:42 -0500 Subject: [PATCH] Add test_forced_iname_deps_and_reduction() (regression test for #24) --- test/test_loopy.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/test/test_loopy.py b/test/test_loopy.py index 96286b73d..1205d209a 100644 --- a/test/test_loopy.py +++ b/test/test_loopy.py @@ -2490,6 +2490,33 @@ def test_clamp(ctx_factory): evt, (out,) = knl(queue, x=x, a=np.float32(12), b=np.float32(15)) +def test_forced_iname_deps_and_reduction(): + i1 = lp.CInstruction("i", + "doSomethingToGetPhi();", + assignees=frozenset({"phi"})) + + from pymbolic.primitives import Subscript, Variable + i2 = lp.Assignment("a", + lp.Reduction("sum", "j", Subscript(Variable("phi"), Variable("j"))), + forced_iname_deps=frozenset(), + forced_iname_deps_is_final=True) + + k = lp.make_kernel("{[i,j] : 0<=i,j 1: exec(sys.argv[1]) -- GitLab