-
Notifications
You must be signed in to change notification settings - Fork 30
Add a new SyclEventRaw class #520
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 new SyclEventRaw class #520
Conversation
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.
Minor changes needed, but looks great!
dpctl/_sycl_event.pyx
Outdated
|
||
|
||
cdef class _SyclEventRaw: | ||
""" Python wrapper class for a cl::sycl::event. |
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.
""" Python wrapper class for a cl::sycl::event. | |
""" Python wrapper class for a ``cl::sycl::event``. |
dpctl/_sycl_event.pyx
Outdated
|
||
|
||
cdef class SyclEventRaw(_SyclEventRaw): | ||
""" Python wrapper class for a cl::sycl::event. |
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.
""" Python wrapper class for a cl::sycl::event. | |
""" Python wrapper class for a ``cl::sycl::event``. |
dpctl/_sycl_event.pyx
Outdated
cdef int ret = 0 | ||
if arg == None: | ||
ret = self._init_event_default() | ||
elif isinstance(arg, _SyclEventRaw): |
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.
We probably want here type(arg) is _SyclEventRaw
.
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.
isinstance
caters for inheritance while type
equality checking does not. Don't we need to consider SyclEventRaw
class when copying?
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.
We do not do so for other classes, SyclDevice
, SyclQueue
, etc.
Perhaps we need to introduce .copy()
methods to all of them.
dpctl/_sycl_event.pyx
Outdated
) | ||
|
||
cdef DPCTLSyclEventRef get_event_ref(self): | ||
""" Returns the DPCTLSyclEventRef pointer for this class. |
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.
""" Returns the DPCTLSyclEventRef pointer for this class. | |
""" Returns the `DPCTLSyclEventRef` pointer for this class. |
dpctl/_sycl_event.pyx
Outdated
DPCTLEvent_Wait(self._event_ref) | ||
|
||
def addressof_ref(self): | ||
""" Returns the address of the C API DPCTLSyclEventRef pointer as |
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.
""" Returns the address of the C API DPCTLSyclEventRef pointer as | |
""" Returns the address of the C API `DPCTLSyclEventRef` pointer as |
dpctl/_sycl_event.pyx
Outdated
a size_t. | ||
|
||
Returns: | ||
The address of the DPCTLSyclEventRef object used to create this |
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.
Same here
dpctl/_sycl_event.pyx
Outdated
|
||
Returns: | ||
The address of the DPCTLSyclEventRef object used to create this | ||
SyclEvent cast to a size_t. |
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.
SyclEvent cast to a size_t. | |
`SyclEvent` cast to a size_t. |
dpctl/_sycl_event.pyx
Outdated
The address of the DPCTLSyclEventRef object used to create this | ||
SyclEvent cast to a size_t. | ||
""" | ||
return int(<size_t>self._event_ref) |
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.
Call to int
constructor is not needed here.
136e7d8
to
634d01e
Compare
@vlad-perevezentsev The Windows Py3.7 build failed because there is not OpenCL CPU driver installed on that machine:
Could you please add logic to skip such a test if the queue creation did not succeed? Please look at other tests (in test file for queue submit) for examples. |
3de8799
to
5600598
Compare
5600598
to
bb81d90
Compare
This PR will add a new
SyclEventRaw
class and tests for it.