diff --git a/test/test_callables.py b/test/test_callables.py index 177c12622..e9f2c0648 100644 --- a/test/test_callables.py +++ b/test/test_callables.py @@ -1430,6 +1430,36 @@ def test_inline_stride(): lp.generate_code_v2(knl).device_code() +@pytest.mark.xfail +@pytest.mark.parametrize("inline", [False, True]) +def test_inames_with_holes(ctx_factory, inline): + child_knl = lp.make_function( + ["{[i]: 0<=i<3}"], + """ + g[i] = 1 + """, name="foo") + parent_knl = lp.make_kernel( + ["{[j]:0<=j<5 and j%4<2}"], + """ + [j]: z[j] = foo() + """, + kernel_data=[ + lp.GlobalArg( + name="z", + dtype=np.float64, + shape=(5,)), + ...], + ) + knl = lp.merge([parent_knl, child_knl]) + if inline: + knl = lp.inline_callable_kernel(knl, "foo") + + ctx = ctx_factory() + queue = cl.CommandQueue(ctx) + + evt, (out,) = knl(queue) + assert np.allclose(out.get(), np.array([1, 1, 0, 0, 1], dtype=np.float64)) + def test_inline_predicate(): # https://github.com/inducer/loopy/issues/739 twice = lp.make_function(