Add a new SyclEventRaw class#520
Add a new SyclEventRaw class#520oleksandr-pavlyk merged 1 commit intoIntelPython:refactor/SyclEventfrom
Conversation
oleksandr-pavlyk
left a comment
There was a problem hiding this comment.
Minor changes needed, but looks great!
|
|
||
|
|
||
| cdef class _SyclEventRaw: | ||
| """ Python wrapper class for a cl::sycl::event. |
There was a problem hiding this comment.
| """ Python wrapper class for a cl::sycl::event. | |
| """ Python wrapper class for a ``cl::sycl::event``. |
|
|
||
|
|
||
| cdef class SyclEventRaw(_SyclEventRaw): | ||
| """ Python wrapper class for a cl::sycl::event. |
There was a problem hiding this comment.
| """ Python wrapper class for a cl::sycl::event. | |
| """ Python wrapper class for a ``cl::sycl::event``. |
| cdef int ret = 0 | ||
| if arg == None: | ||
| ret = self._init_event_default() | ||
| elif isinstance(arg, _SyclEventRaw): |
There was a problem hiding this comment.
We probably want here type(arg) is _SyclEventRaw.
There was a problem hiding this comment.
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.
We do not do so for other classes, SyclDevice, SyclQueue, etc.
Perhaps we need to introduce .copy() methods to all of them.
| ) | ||
|
|
||
| cdef DPCTLSyclEventRef get_event_ref(self): | ||
| """ Returns the DPCTLSyclEventRef pointer for this class. |
There was a problem hiding this comment.
| """ Returns the DPCTLSyclEventRef pointer for this class. | |
| """ Returns the `DPCTLSyclEventRef` pointer for this class. |
| 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.
| """ Returns the address of the C API DPCTLSyclEventRef pointer as | |
| """ Returns the address of the C API `DPCTLSyclEventRef` pointer as |
| a size_t. | ||
|
|
||
| Returns: | ||
| The address of the DPCTLSyclEventRef object used to create this |
|
|
||
| Returns: | ||
| The address of the DPCTLSyclEventRef object used to create this | ||
| SyclEvent cast to a size_t. |
There was a problem hiding this comment.
| SyclEvent cast to a size_t. | |
| `SyclEvent` cast to a size_t. |
| 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.
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
SyclEventRawclass and tests for it.