Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addressed gh-891, improved SyclDevice ctor error message #893

Merged
merged 1 commit into from
Aug 28, 2022

Conversation

oleksandr-pavlyk
Copy link
Collaborator

Improved exception message when SyclDevice could not created from invalid filter string. Closes #891

In [1]: import dpctl

In [2]: dpctl.SyclDevice("invalid")
---------------------------------------------------------------------------
SyclDeviceCreationError                   Traceback (most recent call last)
Input In [2], in <cell line: 1>()
----> 1 dpctl.SyclDevice("invalid")

File ~/repos/dpctl/dpctl/_sycl_device.pyx:295, in dpctl._sycl_device.SyclDevice.__cinit__()
    293             ret = self._init_from_selector(DSRef)
    294             if ret == -1:
--> 295                 raise SyclDeviceCreationError(
    296                     "Could not create a SyclDevice with the selector string "
    297                     "'{selector_string}'".format(selector_string=arg)

SyclDeviceCreationError: Could not create a SyclDevice with the selector string 'invalid'
  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?

@github-actions
Copy link

@coveralls
Copy link
Collaborator

Coverage Status

Coverage increased (+0.002%) to 81.842% when pulling b3e07bf on gh-891-better-error-msg into 8414053 on master.

@oleksandr-pavlyk oleksandr-pavlyk mentioned this pull request Aug 27, 2022
1 task
@oleksandr-pavlyk oleksandr-pavlyk force-pushed the gh-891-better-error-msg branch from b3e07bf to 3f3f25a Compare August 28, 2022 16:35
@oleksandr-pavlyk oleksandr-pavlyk merged commit 8655e98 into master Aug 28, 2022
@oleksandr-pavlyk oleksandr-pavlyk deleted the gh-891-better-error-msg branch August 28, 2022 17:42
@github-actions
Copy link

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Usability] put the requested device selector string in the exception message
2 participants