Skip to content

Redesign SyclEvent class #391

Closed
Closed
@oleksandr-pavlyk

Description

@oleksandr-pavlyk

dpctl.SyclEvent needs to closely follow SYCL interface.

C-API changes needed

  • In C-API we need DPCTLEvent_Copy.

  • We should either use e.wait_and_throw() in DPCTLEvent_Wait, or introduce DPCTLEvent_WaitAndThrow(ERef).

  • Since sycl::event is a associated with a SYCL backend, we should support DPCTLEvent_GetBackend(ERef).

  • sycl::event::get_wait_list() returning a vector of events, should be exposed via DPCTLEvent_GetWaitList(ERef).

  • sycl::event::get_info<sycl::info::event::command_execution_status>() returning an enum class event_command_status : int { submitted, running, complete} should be exposed via DPCTLEvent_GetCommandExecutionStatus(ERef).

  • sycl::event::get_profiling_info<sycl::info::event_profiling::command_submit>(), sycl::event::get_profiling_info<sycl::info::event_profiling::command_start>() and sycl::event::get_profiling_info<sycl::info::event_profiling::command_end>() returning uint64_t value of device timer corresponding to the logged time of referenced operations. These are blocking operations (i.e. wait on the event), and throw sycl::invalid_object_code if the queue that created the event did not have profiling enabled.

Python API changes needed

  • dpctl.SyclEvent() should create object corresponding to sycl::event().
  • dpctl.SyclEvent( _SyclEvent ) should copy event from _SyclEvent like other constructors do. _SyclEvent is the helper data owner responsible for calling DPCTLEvent_Delete. Do not think __dealloc__ needs to call DPCTLEvent_Wait().
  • dpctl.SyclEvent( event_capsule ) where event_capsule is named "SyclEventRef" and stores pointer to sycl::event object should create a dpctl.SyclEvent carrying a copy of that sycl::event object.
  • dpctl.SyclEvent.execution_status should return either an enum, or a string
  • dpctl.SyclEvent.profiled_info.submit, dpctl.SyclEvent.profiled_info.start, dpctl.SyclEvent.profiled_info.end would return profiling data.
  • dpctl.SyclEvent.get_backend() should return backend enum.
  • I think dpctl.SyclEvent.wait() should call e.wait_and_throw().
  • dpctl.SyclEvent.wait_list() should return a list of dpctl.SyclEvent instances
  • Static method dpctl.SyclEvent.wait( event or a list of events ) should be implement for synchronously wait_and_throw on the given event or list of events.

N.B.: The functionality to combine multiple events into a single event perhaps belongs to dpctl.SyclQueue, where it would submit an empty single_task, and use depends_on the given list of events.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions