Skip to content

Commit 2fe2791

Browse files
Fix test_create_program_from_source to not use out-of-bounds fill-value
Restrict the input size to allow math the test relies on to work without using out-of-bounds Python scalar inputs to tensor.arange
1 parent 216d1ca commit 2fe2791

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

dpctl/tests/test_sycl_kernel_submit.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ def test_create_program_from_source(ctype_str, dtype, ctypes_ctor):
6666

6767
n_elems = 1024 * 512
6868
lws = 128
69+
if dtype.kind in "ui":
70+
n_elems = min(n_elems, dpt.iinfo(dtype).max)
71+
n_elems = (n_elems // lws) * lws
6972
a = dpt.arange(n_elems, dtype=dtype, sycl_queue=q)
7073
b = dpt.arange(n_elems, stop=0, step=-1, dtype=dtype, sycl_queue=q)
7174
c = dpt.zeros(n_elems, dtype=dtype, sycl_queue=q)

0 commit comments

Comments
 (0)