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
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.
dpctl.SyclEventneeds to closely follow SYCL interface.C-API changes needed
In C-API we need
DPCTLEvent_Copy.We should either use
e.wait_and_throw()inDPCTLEvent_Wait, or introduceDPCTLEvent_WaitAndThrow(ERef).Since
sycl::eventis a associated with a SYCL backend, we should supportDPCTLEvent_GetBackend(ERef).sycl::event::get_wait_list()returning a vector of events, should be exposed viaDPCTLEvent_GetWaitList(ERef).sycl::event::get_info<sycl::info::event::command_execution_status>()returning anenum class event_command_status : int { submitted, running, complete}should be exposed viaDPCTLEvent_GetCommandExecutionStatus(ERef).sycl::event::get_profiling_info<sycl::info::event_profiling::command_submit>(),sycl::event::get_profiling_info<sycl::info::event_profiling::command_start>()andsycl::event::get_profiling_info<sycl::info::event_profiling::command_end>()returninguint64_tvalue of device timer corresponding to the logged time of referenced operations. These are blocking operations (i.e. wait on the event), and throwsycl::invalid_object_codeif the queue that created the event did not have profiling enabled.Python API changes needed
dpctl.SyclEvent()should create object corresponding tosycl::event().dpctl.SyclEvent( _SyclEvent )should copy event from_SyclEventlike other constructors do._SyclEventis the helper data owner responsible for callingDPCTLEvent_Delete. Do not think__dealloc__needs to callDPCTLEvent_Wait().dpctl.SyclEvent( event_capsule )whereevent_capsuleis named"SyclEventRef"and stores pointer tosycl::eventobject should create adpctl.SyclEventcarrying a copy of thatsycl::eventobject.dpctl.SyclEvent.execution_statusshould return either an enum, or a stringdpctl.SyclEvent.profiled_info.submit,dpctl.SyclEvent.profiled_info.start,dpctl.SyclEvent.profiled_info.endwould return profiling data.dpctl.SyclEvent.get_backend()should return backend enum.dpctl.SyclEvent.wait()should calle.wait_and_throw().dpctl.SyclEvent.wait_list()should return a list ofdpctl.SyclEventinstancesdpctl.SyclEvent.wait( event or a list of events )should be implement for synchronouslywait_and_throwon 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 emptysingle_task, and usedepends_onthe given list of events.