Skip to content

Commit 91e4243

Browse files
Added test for usm_ndarray properties
1 parent dedab4e commit 91e4243

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

dpctl/tests/test_usm_ndarray_ctor.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,11 @@ def test_ctor_invalid_shape():
258258
dpt.usm_ndarray(dict())
259259

260260

261+
def test_ctor_invalid_order():
262+
with pytest.raises(ValueError):
263+
dpt.usm_ndarray((5, 5, 3), order="Z")
264+
265+
261266
def test_ctor_buffer_kwarg():
262267
dpt.usm_ndarray(10, buffer=b"device")
263268
with pytest.raises(ValueError):
@@ -269,3 +274,20 @@ def test_ctor_buffer_kwarg():
269274
)
270275
with pytest.raises(ValueError):
271276
dpt.usm_ndarray(10, buffer=dict())
277+
278+
279+
def test_usm_ndarray_props():
280+
Xusm = dpt.usm_ndarray((10, 5), dtype="c16", order="F")
281+
Xusm.ndim
282+
repr(Xusm)
283+
Xusm.flags
284+
Xusm.__sycl_usm_array_interface__
285+
Xusm.device
286+
Xusm.strides
287+
Xusm.real
288+
Xusm.imag
289+
try:
290+
dpctl.SyclQueue("cpu")
291+
except dpctl.SyclQueueCreationError:
292+
pytest.skip("Sycl device CPU was not detected")
293+
Xusm.to_device("cpu")

0 commit comments

Comments
 (0)