-
Notifications
You must be signed in to change notification settings - Fork 31
Add a get_backend
method for the SyclEventRaw class
#521
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
Add a get_backend
method for the SyclEventRaw class
#521
Conversation
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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please implement access to backend using SyclEventRaw.backend
readonly property
2a9d56f
to
08e8445
Compare
dpctl/_sycl_event.pyx
Outdated
@@ -222,3 +224,19 @@ cdef class SyclEventRaw(_SyclEventRaw): | |||
return event_status_type.complete | |||
else: | |||
raise ValueError("Unknown event status.") | |||
|
|||
@property | |||
def get_backend(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def get_backend(self): | |
def backend(self): |
08e8445
to
822f4f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
This PR will add a
get_backend
method for theSyclEventRaw
class which returns the backend enum.