Skip to content

Commit 8062c0c

Browse files
Move emulated aspect from list of unsupported to list of support aspects
Fixed test_unsupported_aspect to use hasattr instead of select_device_with_aspects, because system might not have any devices with specified aspect, e.g., 'emulated' aspect.
1 parent 5a8fa2e commit 8062c0c

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

dpctl/tests/test_sycl_device.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,12 @@ def test_equal():
163163
"atomic64",
164164
"usm_atomic_host_allocations",
165165
"usm_atomic_shared_allocations",
166+
"emulated",
166167
]
167168

168169
# SYCL 2020 spec aspects not presently
169170
# supported in DPC++, and dpctl
170-
list_of_unsupported_aspects = [
171-
"emulated",
172-
]
171+
list_of_unsupported_aspects = []
173172

174173

175174
@pytest.fixture(params=list_of_supported_aspects)
@@ -199,14 +198,14 @@ def test_supported_aspect(supported_aspect):
199198

200199
def test_unsupported_aspect(unsupported_aspect):
201200
try:
202-
dpctl.select_device_with_aspects(unsupported_aspect)
201+
d = dpctl.SyclDevice()
202+
has_it = hasattr(d, "has_aspect_" + unsupported_aspect)
203+
except dpctl.SyclDeviceCreationError:
204+
has_it = False
205+
if has_it:
203206
raise AttributeError(
204207
f"The {unsupported_aspect} aspect is now supported in dpctl"
205208
)
206-
except AttributeError:
207-
pytest.skip(
208-
f"The {unsupported_aspect} aspect is not supported in dpctl"
209-
)
210209

211210

212211
def test_handle_no_device():

0 commit comments

Comments
 (0)