diff --git a/test/test_loopy.py b/test/test_loopy.py index 9d1e2d155c741c5c1a8919ecf846c00931d7c1fb..d56caf0e86e0c4964b6cb8c7164282ff701d953f 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: