Skip to content

Commit 1f34ee8

Browse files
Added a test to cover Device class (data-API style)
1 parent 61d94d4 commit 1f34ee8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

dpctl/tests/test_usm_ndarray_ctor.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,3 +357,19 @@ def test_usm_ndarray_props():
357357
except dpctl.SyclQueueCreationError:
358358
pytest.skip("Sycl device CPU was not detected")
359359
Xusm.to_device("cpu")
360+
361+
362+
def test_datapi_device():
363+
X = dpt.usm_ndarray(1)
364+
dev_t = type(X.device)
365+
with pytest.raises(TypeError):
366+
dev_t()
367+
dev_t.create_device(X.device)
368+
dev_t.create_device(X.sycl_queue)
369+
dev_t.create_device(X.sycl_device)
370+
dev_t.create_device(X.sycl_device.filter_string)
371+
dev_t.create_device(None)
372+
X.device.sycl_context
373+
X.device.sycl_queue
374+
X.device.sycl_device
375+
repr(X.device)

0 commit comments

Comments
 (0)