File tree Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -253,17 +253,8 @@ cdef class SyclDevice(_SyclDevice):
253
253
cdef const char * filter_c_str = NULL
254
254
cdef int ret = 0
255
255
256
- if type (arg) is unicode :
257
- string = bytes(< unicode > arg, " utf-8" )
258
- filter_c_str = string
259
- DSRef = DPCTLFilterSelector_Create(filter_c_str)
260
- ret = self ._init_from_selector(DSRef)
261
- if ret == - 1 :
262
- raise ValueError (
263
- " Could not create a SyclDevice with the selector string"
264
- )
265
- elif isinstance (arg, unicode ):
266
- string = bytes(< unicode > unicode (arg), " utf-8" )
256
+ if type (arg) is str :
257
+ string = bytes(< str > arg, " utf-8" )
267
258
filter_c_str = string
268
259
DSRef = DPCTLFilterSelector_Create(filter_c_str)
269
260
ret = self ._init_from_selector(DSRef)
Original file line number Diff line number Diff line change 51
51
"opencl:gpu:-1" ,
52
52
"cuda:cpu:0" ,
53
53
"abc" ,
54
+ 1 ,
54
55
]
55
56
56
57
@@ -470,6 +471,10 @@ def check_print_device_info(device):
470
471
pytest .fail ("Encountered an exception inside print_device_info()." )
471
472
472
473
474
+ def check_repr (device ):
475
+ assert type (repr (device )) is str
476
+
477
+
473
478
list_of_checks = [
474
479
check_get_max_compute_units ,
475
480
check_get_max_work_item_dims ,
@@ -523,6 +528,7 @@ def check_print_device_info(device):
523
528
check_create_sub_devices_by_affinity_L1_cache ,
524
529
check_create_sub_devices_by_affinity_next_partitionable ,
525
530
check_print_device_info ,
531
+ check_repr ,
526
532
]
527
533
528
534
You can’t perform that action at this time.
0 commit comments