Skip to content

Commit 8c6a57e

Browse files
committed
Adds a test for fix to gh-1689
1 parent 97b1c82 commit 8c6a57e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

dpctl/tests/test_usm_ndarray_searchsorted.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,3 +355,19 @@ def test_out_of_bound_sorter_values():
355355
p = dpt.searchsorted(x, x2, sorter=sorter)
356356
# verify that they were applied with mode="wrap"
357357
assert dpt.all(p == dpt.arange(3, dtype=p.dtype))
358+
359+
360+
def test_searchsorted_strided_scalar_needle():
361+
get_queue_or_skip()
362+
363+
a_max = 255
364+
365+
hay_stack = dpt.flip(
366+
dpt.repeat(dpt.arange(a_max - 1, -1, -1, dtype=dpt.int32), 4)
367+
)
368+
needles_np = np.squeeze(
369+
np.random.randint(0, a_max, dtype=dpt.int32, size=1), axis=0
370+
)
371+
needles = dpt.asarray(needles_np)
372+
373+
_check(hay_stack, needles, needles_np)

0 commit comments

Comments
 (0)