Skip to content

Commit 63ce96f

Browse files
authored
Set _cpu_device and _gpu_device to None by default (#75)
1 parent 304931b commit 63ce96f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

dpctl/ocldrv.py

+2
Original file line numberDiff line numberDiff line change
@@ -526,11 +526,13 @@ def __new__(cls):
526526
if cls._runtime[0][0].has_cpu:
527527
cls._cpu_device = DeviceEnv(cls._runtime[0][0].first_cpu_env)
528528
else:
529+
cls._cpu_device = None
529530
_logger.warning("No CPU device")
530531

531532
if cls._runtime[0][0].has_gpu:
532533
cls._gpu_device = DeviceEnv(cls._runtime[0][0].first_gpu_env)
533534
else:
535+
cls._gpu_device = None
534536
_logger.warning("No GPU device")
535537

536538
cls._curr_device = DeviceEnv(cls._runtime[0][0].curr_env)

0 commit comments

Comments
 (0)