Skip to content

Commit 47239cd

Browse files
committed
Add tests based on gh-2017
1 parent e2d2b3f commit 47239cd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

dpctl/tests/test_tensor_accumulation.py

+12
Original file line numberDiff line numberDiff line change
@@ -421,3 +421,15 @@ def test_cumulative_sum_gh_1901(p):
421421
inp = dpt.ones(n, dtype=dt)
422422
r = dpt.cumulative_sum(inp, dtype=dt)
423423
assert dpt.all(r == dpt.arange(1, n + 1, dtype=dt))
424+
425+
426+
@pytest.mark.parametrize(
427+
"dt", ["i1", "i2", "i4", "i8", "f2", "f4", "f8", "c8", "c16"]
428+
)
429+
def test_gh_2017(dt):
430+
"See https://github.com/IntelPython/dpctl/issues/2017"
431+
q = get_queue_or_skip()
432+
skip_if_dtype_not_supported(dt, q)
433+
x = dpt.asarray([-1, 1], dtype=dpt.dtype(dt), sycl_queue=q)
434+
r = dpt.cumulative_sum(x, dtype="?")
435+
assert dpt.all(r)

0 commit comments

Comments
 (0)