From be1222ad0a952b692c49c8abf2a971abdbbe8e65 Mon Sep 17 00:00:00 2001 From: arghdos Date: Tue, 25 Oct 2016 16:34:06 -0400 Subject: [PATCH] add test for constant arg array --- test/test_loopy.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/test_loopy.py b/test/test_loopy.py index 9d1e2d155..d56caf0e8 100644 --- a/test/test_loopy.py +++ b/test/test_loopy.py @@ -1459,6 +1459,25 @@ def test_unr_and_conditionals(ctx_factory): lp.auto_test_vs_ref(ref_knl, ctx, knl) +def test_constant_array_args(ctx_factory): + ctx = ctx_factory() + + knl = lp.make_kernel('{[k]: 0<=k Tcond[k] = T[k] < 0.5 + if Tcond[k] + cp[k] = 2 * T[k] + Tcond[k] + end + end + """, + [lp.ConstantArg('T', shape=(200,), dtype=np.float32), + '...']) + + knl = lp.fix_parameters(knl, n=200) + + print(lp.generate_code_v2(knl).device_code()) + if __name__ == "__main__": if len(sys.argv) > 1: -- GitLab