Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions dpnp/tests/third_party/cupy/math_tests/test_sumprod.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,23 @@ def test_cumsum_axis(self, xp, dtype, axis):
a = testing.shaped_arange(tuple(range(4, 4 + n)), xp, dtype)
return self._cumsum(xp, a, axis=axis)

@testing.for_all_dtypes()
@testing.numpy_cupy_allclose(contiguous_check=False)
@pytest.mark.parametrize("order", ["C", "F"])
def test_cumsum_no_axis(self, xp, dtype, order):
a = testing.shaped_arange((4, 3), xp, dtype)
out = xp.empty((12,), dtype=dtype)

if order in ("c", "C"):
out = xp.ascontiguousarray(out)
elif order in ("f", "F"):
out = xp.asfortranarray(out)

b = a.copy()
xp.cumsum(a, out=out, dtype=dtype)
testing.assert_array_equal(a, b) # Check if input array is overwritten
return out

@pytest.mark.parametrize("axis", axes)
@testing.for_all_dtypes()
@testing.numpy_cupy_allclose()
Expand Down
Loading