Skip to content

Commit 0075758

Browse files
authored
Fix handling of device string (#966)
1 parent 50c60ba commit 0075758

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

sklearnex/_device_offload.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,14 @@ def _get_global_queue():
6969

7070
if target != 'auto':
7171
if d4p_target is not None and \
72-
d4p_target != target and \
73-
d4p_target not in target.sycl_device.get_filter_string():
74-
raise RuntimeError("Cannot use target offload option "
75-
"inside daal4py.oneapi.sycl_context")
72+
d4p_target != target:
73+
if not isinstance(target, str):
74+
if d4p_target not in target.sycl_device.get_filter_string():
75+
raise RuntimeError("Cannot use target offload option "
76+
"inside daal4py.oneapi.sycl_context")
77+
else:
78+
raise RuntimeError("Cannot use target offload option "
79+
"inside daal4py.oneapi.sycl_context")
7680
if isinstance(target, QueueClass):
7781
return target
7882
return QueueClass(target)

0 commit comments

Comments
 (0)