File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -177,10 +177,17 @@ def test_get_devices_with_device_type_enum(device_type):
177
177
178
178
179
179
def test_get_devices_with_device_type_str (device_type_str ):
180
- devices = dpctl .get_devices (device_type = device_type_str )
181
- if len (devices ):
182
- d = string_to_device_type (device_type_str )
183
- check_if_device_type_matches (devices , d )
180
+ num_devices = dpctl .get_num_devices (device_type = device_type_str )
181
+ if num_devices > 0 :
182
+ devices = dpctl .get_devices (device_type = device_type_str )
183
+ assert len (devices ) == num_devices
184
+ dty = string_to_device_type (device_type_str )
185
+ check_if_device_type_matches (devices , dty )
184
186
check_if_device_type_is_valid (devices )
187
+ # check for consistency of ordering between filter selector
188
+ # where backend is omitted, but device type and id is specified
189
+ for i in range (num_devices ):
190
+ dev = dpctl .SyclDevice (":" .join ((device_type_str , str (i ))))
191
+ assert dev == devices [i ]
185
192
else :
186
193
pytest .skip ()
You can’t perform that action at this time.
0 commit comments