Skip to content

Commit d133a11

Browse files
Add a test based on example from gh-1901
1 parent abb1572 commit d133a11

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

dpctl/tests/test_tensor_accumulation.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,3 +410,14 @@ def test_cumulative_logsumexp_closed_form(fpdt):
410410

411411
tol = 4 * dpt.finfo(fpdt).eps
412412
assert dpt.allclose(r, expected, atol=tol, rtol=tol)
413+
414+
415+
@pytest.mark.parametrize("p", [257, 260, 273, 280, 509, 512])
416+
def test_cumulative_sum_gh_1901(p):
417+
get_queue_or_skip()
418+
419+
n = p * p
420+
dt = dpt.int32
421+
inp = dpt.ones(n, dtype=dt)
422+
r = dpt.cumulative_sum(inp, dtype=dt)
423+
assert dpt.all(r == dpt.arange(1, n + 1, dtype=dt))

0 commit comments

Comments
 (0)