Add a get_backend method for the SyclEventRaw class#521
Merged
oleksandr-pavlyk merged 1 commit intoIntelPython:refactor/SyclEventfrom Aug 16, 2021
Merged
Conversation
Collaborator
Contributor
|
Following choices made for other classes, accessing backend info should be implemented using In [1]: import dpctl
In [2]: ev = dpctl.SyclEventRaw()
In [3]: !git log -1
commit 2a9d56ff46703e82a1702da57cc07f2fb66cddaf (HEAD -> cython_getbackend, vlad/cython_getbackend)
Merge: 18cd26d 414de9c
Author: << elided >>
Date: Wed Aug 11 12:15:46 2021 -0500
Merge branch 'refactor/SyclEvent' into cython_getbackend
In [4]: ev.backend
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-4-4c072d4c7aeb> in <module>
----> 1 ev.backend
AttributeError: 'dpctl._sycl_event.SyclEventRaw' object has no attribute 'backend'
In [5]: ev.get_backend()
Out[5]: <backend_type.host: 3>
In [6]: d = dpctl.SyclDevice() # compare
In [7]: d.backend
Out[7]: <backend_type.level_zero: 4> |
oleksandr-pavlyk
suggested changes
Aug 13, 2021
Contributor
oleksandr-pavlyk
left a comment
There was a problem hiding this comment.
Please implement access to backend using SyclEventRaw.backend readonly property
2a9d56f to
08e8445
Compare
| raise ValueError("Unknown event status.") | ||
|
|
||
| @property | ||
| def get_backend(self): |
Contributor
There was a problem hiding this comment.
Suggested change
| def get_backend(self): | |
| def backend(self): |
oleksandr-pavlyk
suggested changes
Aug 16, 2021
08e8445 to
822f4f8
Compare
vlad-perevezentsev
added a commit
to vlad-perevezentsev/dpctl
that referenced
this pull request
Aug 23, 2021
vlad-perevezentsev
added a commit
that referenced
this pull request
Aug 23, 2021
oleksandr-pavlyk
pushed a commit
that referenced
this pull request
Aug 25, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR will add a
get_backendmethod for theSyclEventRawclass which returns the backend enum.