dpctl.SyclEvent
- class dpctl.SyclEvent(arg=None)
Python class representing
sycl::event
. There are multiple ways to create adpctl.SyclEvent
object:Invoking the constructor with no arguments creates a ready event using the default constructor of the
sycl::event
.
- Example:
import dpctl # Create a default SyclEvent e = dpctl.SyclEvent()
Invoking the constructor with a named
PyCapsule
with name “SyclEventRef” that carries a pointer to asycl::event
object. The capsule will be renamed upon successful consumption to ensure one-time use. A new named capsule can be constructed by usingdpctl.SyclEvent._get_capsule()
method.
- Parameters:
arg (optional) – Defaults to
None
. The argument can be adpctl.SyclEvent
instance, adpctl.SyclEvent
instance, or a namedPyCapsule
called “SyclEventRef”.- Raises:
ValueError – If the
dpctl.SyclEvent
object creation failed.TypeError – In case of incorrect arguments given to constructors, unexpected types of input arguments, or in the case the input capsule contained a null pointer or could not be renamed.
Attributes:
Returns the backend_type enum value for the device associated with this event.
Returns the event_status_type enum value for this event.
Returns the 64-bit time value in nanoseconds when
sycl::command_group
finished execution on the device.Returns the 64-bit time value in nanoseconds when
sycl::command_group
started execution on the device.Returns the 64-bit time value in nanoseconds when
sycl::command_group
was submitted to the queue.Public methods:
Returns the address of the C API DPCTLSyclEventRef pointer as a size_t.
Returns the list of
dpctl.SyclEvent
objects that depend on this event.wait
()Synchronously wait for completion of this event.
wait_for
(event)Waits for a given event or a sequence of events.
Private methods:
Returns a copy of the underlying
sycl::event
pointer as a void pointer inside a namedPyCapsule
that has the name SyclEventRef.
Attributes
- SyclEvent.backend
Returns the backend_type enum value for the device associated with this event.
- Returns:
The backend for the device.
- Return type:
- SyclEvent.execution_status
Returns the event_status_type enum value for this event.
- SyclEvent.profiling_info_end
Returns the 64-bit time value in nanoseconds when
sycl::command_group
finished execution on the device.
- SyclEvent.profiling_info_start
Returns the 64-bit time value in nanoseconds when
sycl::command_group
started execution on the device.
- SyclEvent.profiling_info_submit
Returns the 64-bit time value in nanoseconds when
sycl::command_group
was submitted to the queue.
Public methods
- dpctl.SyclEvent.addressof_ref(self)
Returns the address of the C API DPCTLSyclEventRef pointer as a size_t.
- Returns:
The address of the DPCTLSyclEventRef object used to create this SyclEvent cast to a size_t.
- dpctl.SyclEvent.get_wait_list(self)
Returns the list of
dpctl.SyclEvent
objects that depend on this event.
- dpctl.SyclEvent.wait(self)
Synchronously wait for completion of this event.
- dpctl.SyclEvent.wait_for(event)
Waits for a given event or a sequence of events.
Private methods
- dpctl.SyclEvent._get_capsule(self)
Returns a copy of the underlying
sycl::event
pointer as a void pointer inside a namedPyCapsule
that has the name SyclEventRef. The ownership of the pointer inside the capsule is passed to the caller, and pointer is deleted when the capsule goes out of scope.- Returns:
A capsule object storing a copy of the
sycl::event
pointer belonging to adpctl.SyclEvent
instance.- Return type:
pycapsule
- Raises:
ValueError – If the
DPCTLEvent_Copy
fails to copy thesycl::event
pointer.