Skip to content

Commit

Permalink
Update cupy buffer protocol copy test
Browse files Browse the repository at this point in the history
  • Loading branch information
asmeurer committed Mar 21, 2024
1 parent 166c650 commit a194344
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,8 @@ def test_asarray_copy(library):
b = asarray(a, copy=None)
assert is_lib_func(b)
a[0] = 0.0
assert all(b[0] == 0.0)
if library == 'cupy':
# A copy is required for libraries where the default device is not CPU
assert all(b[0] == 1.0)
else:
assert all(b[0] == 0.0)

0 comments on commit a194344

Please sign in to comment.