Skip to content

Commit 9c1e37d

Browse files
committed
Test output of non-written arrays
1 parent a8340f7 commit 9c1e37d

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

test/test_target.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,20 @@ def test_zero_size_temporaries(ctx_factory):
708708
assert out.shape == (0,)
709709

710710

711+
def test_empty_array_output(ctx_factory):
712+
ctx = ctx_factory()
713+
cq = cl.CommandQueue(ctx)
714+
715+
knl = lp.make_kernel(
716+
"{[i]: i > 0 and i < 0}",
717+
[],
718+
[lp.GlobalArg("a", shape=(0,), dtype=np.float32,
719+
is_output=True, is_input=False)])
720+
721+
_evt, (out, ) = knl(cq)
722+
assert out.shape == (0,)
723+
724+
711725
if __name__ == "__main__":
712726
if len(sys.argv) > 1:
713727
exec(sys.argv[1])

0 commit comments

Comments
 (0)