Skip to content

Commit 21d6cb6

Browse files
committed
Add test coverage
1 parent 91391cf commit 21d6cb6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

dpnp/tests/test_ndarray.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,18 @@ def test_error(self):
176176
ia.item()
177177

178178

179+
class TestUsmNdarrayProtocol:
180+
def test_basic(self):
181+
a = dpnp.arange(256, dtype=dpnp.int64)
182+
usm_a = dpt.asarray(a)
183+
184+
assert a.sycl_queue == usm_a.sycl_queue
185+
assert a.usm_type == usm_a.usm_type
186+
assert a.dtype == usm_a.dtype
187+
assert usm_a.usm_data.reference_obj is None
188+
assert (a == usm_a).all()
189+
190+
179191
def test_print_dpnp_int():
180192
result = repr(dpnp.array([1, 0, 2, -3, -1, 2, 21, -9], dtype="i4"))
181193
expected = "array([ 1, 0, 2, -3, -1, 2, 21, -9], dtype=int32)"

0 commit comments

Comments
 (0)