dpctl.SyclEvent

class dpctl.SyclEvent(arg=None)

Python class representing sycl::event. There are multiple ways to create a dpctl.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 a sycl::event object. The capsule will be renamed upon successful consumption to ensure one-time use. A new named capsule can be constructed by using dpctl.SyclEvent._get_capsule() method.

Parameters:

arg (optional) – Defaults to None. The argument can be a dpctl.SyclEvent instance, a dpctl.SyclEvent instance, or a named PyCapsule 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:

backend

Returns the backend_type enum value for the device associated with this event.

execution_status

Returns the event_status_type enum value for this event.

profiling_info_end

Returns the 64-bit time value in nanoseconds when sycl::command_group finished execution on the device.

profiling_info_start

Returns the 64-bit time value in nanoseconds when sycl::command_group started execution on the device.

profiling_info_submit

Returns the 64-bit time value in nanoseconds when sycl::command_group was submitted to the queue.

Public methods:

addressof_ref()

Returns the address of the C API DPCTLSyclEventRef pointer as a size_t.

get_wait_list()

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:

_get_capsule()

Returns a copy of the underlying sycl::event pointer as a void pointer inside a named PyCapsule 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:

backend_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 named PyCapsule 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 a dpctl.SyclEvent instance.

Return type:

pycapsule

Raises:

ValueError – If the DPCTLEvent_Copy fails to copy the sycl::event pointer.