Skip to content

Commit 3e2ea1c

Browse files
SUAI processing: disallow zero shapes also when strides are given
1 parent 4afd698 commit 3e2ea1c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

dpctl/memory/_sycl_usm_array_interface_utils.pxi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ cdef object _pointers_from_shape_and_stride(
8989
for i in range(nd):
9090
str_i = int(ary_strides[i])
9191
sh_i = int(ary_shape[i])
92+
if (sh_i <= 0):
93+
raise ValueError("Array shape elements need to be positive")
9294
if (str_i > 0):
9395
max_disp += str_i * (sh_i - 1)
9496
else:

0 commit comments

Comments
 (0)