Skip to content

Commit d094443

Browse files
Skip tests if device does not natively support data type
1 parent 433c4d7 commit d094443

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

dpctl/tests/test_usm_ndarray_dlpack.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import ctypes
1818

1919
import pytest
20+
from helper import skip_if_dtype_not_supported
2021

2122
import dpctl
2223
import dpctl.tensor as dpt
@@ -71,6 +72,7 @@ def test_dlpack_exporter(typestr, usm_type):
7172
caps_fn.argtypes = [ctypes.py_object, ctypes.c_char_p]
7273
all_root_devices = dpctl.get_devices()
7374
for sycl_dev in all_root_devices:
75+
skip_if_dtype_not_supported(typestr, sycl_dev)
7476
X = dpt.empty((64,), dtype=typestr, usm_type=usm_type, device=sycl_dev)
7577
caps = X.__dlpack__()
7678
assert caps_fn(caps, b"dltensor")
@@ -95,6 +97,7 @@ def test_dlpack_exporter_stream():
9597
def test_from_dlpack(shape, typestr, usm_type):
9698
all_root_devices = dpctl.get_devices()
9799
for sycl_dev in all_root_devices:
100+
skip_if_dtype_not_supported(typestr, sycl_dev)
98101
X = dpt.empty(shape, dtype=typestr, usm_type=usm_type, device=sycl_dev)
99102
Y = dpt.from_dlpack(X)
100103
assert X.shape == Y.shape

0 commit comments

Comments
 (0)