Skip to content
Merged
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
8 changes: 6 additions & 2 deletions dpctl/tests/test_usm_ndarray_dlpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,11 @@ def test_from_dlpack(shape, typestr, usm_type):
Y = dpt.from_dlpack(X)
assert X.shape == Y.shape
assert X.dtype == Y.dtype
assert X.sycl_device == Y.sycl_device
assert X.usm_type == Y.usm_type
assert X._pointer == Y._pointer
# we can only expect device to round-trip for USM-device and
# USM-shared allocations, which are made for specific device
assert (Y.usm_type == "host") or (X.sycl_device == Y.sycl_device)
if Y.ndim:
V = Y[::-1]
W = dpt.from_dlpack(V)
Expand All @@ -149,9 +151,11 @@ def test_from_dlpack_strides(mod, typestr, usm_type):
Y = dpt.from_dlpack(X)
assert X.shape == Y.shape
assert X.dtype == Y.dtype
assert X.sycl_device == Y.sycl_device
assert X.usm_type == Y.usm_type
assert X._pointer == Y._pointer
# we can only expect device to round-trip for USM-device and
# USM-shared allocations, which are made for specific device
assert (Y.usm_type == "host") or (X.sycl_device == Y.sycl_device)
if Y.ndim:
V = Y[::-1]
W = dpt.from_dlpack(V)
Expand Down