Skip to content

Commit

Permalink
Merge pull request #854 from IntelPython/fix-manual-examples
Browse files Browse the repository at this point in the history
update expected exception type when creating devices
  • Loading branch information
oleksandr-pavlyk authored Jun 28, 2022
2 parents 16ed729 + ce62bb9 commit 42afc0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/python/device_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def create_gpu_device():
d2 = dpctl.select_gpu_device()
assert d1 == d2
d1.print_device_info()
except ValueError:
except dpctl.SyclDeviceCreationError:
print("A GPU device is not available on the system")


Expand Down
6 changes: 3 additions & 3 deletions examples/python/filter_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ def select_using_filter():
try:
d1 = dpctl.SyclDevice("cpu")
d1.print_device_info()
except ValueError:
except dpctl.SyclDeviceCreationError:
print("A CPU type device is not available on the system")

try:
d1 = dpctl.SyclDevice("opencl:cpu:0")
d1.print_device_info()
except ValueError:
except dpctl.SyclDeviceCreationError:
print("An OpenCL CPU driver needs to be installed on the system")

d1 = dpctl.SyclDevice("0")
Expand All @@ -43,7 +43,7 @@ def select_using_filter():
try:
d1 = dpctl.SyclDevice("gpu")
d1.print_device_info()
except ValueError:
except dpctl.SyclDeviceCreationError:
print("A GPU type device is not available on the system")


Expand Down

0 comments on commit 42afc0c

Please sign in to comment.