#[repr(transparent)]pub struct RawEvent(_);
Expand description
Raw OpenCL event
Implementations§
source§impl RawEvent
impl RawEvent
pub const unsafe fn from_id_unchecked(inner: cl_event) -> Self
pub const unsafe fn from_id(inner: cl_event) -> Option<Self>
pub const fn id(&self) -> cl_event
pub unsafe fn retain(&self) -> Result<()>
pub fn join_by_ref(&self) -> Result<()>
sourcepub fn join_all_by_ref(v: &[RawEvent]) -> Result<()>
pub fn join_all_by_ref(v: &[RawEvent]) -> Result<()>
Blocks the current thread until all the events have completed
source§impl RawEvent
impl RawEvent
sourcepub fn into_event(self) -> NoopEvent
pub fn into_event(self) -> NoopEvent
pub fn join_with_nanos_by_ref(self) -> Result<ProfilingInfo<u64>>
pub fn join_with_time_by_ref(self) -> Result<ProfilingInfo<SystemTime>>
pub fn join_with_duration_by_ref(self) -> Result<Duration>
sourcepub fn join_unwrap_by_ref(self)
pub fn join_unwrap_by_ref(self)
Blocks the current thread util the event has completed, returning data
if it completed correctly, and panicking otherwise.
sourcepub fn ty(&self) -> Result<CommandType>
pub fn ty(&self) -> Result<CommandType>
Returns the event’s type
sourcepub fn status(&self) -> Result<EventStatus>
pub fn status(&self) -> Result<EventStatus>
Returns the event’s current status
sourcepub fn command_queue(&self) -> Result<Option<RawCommandQueue>>
pub fn command_queue(&self) -> Result<Option<RawCommandQueue>>
Returns the event’s underlying command queue
pub fn reference_count(&self) -> Result<u32>
sourcepub fn raw_context(&self) -> Result<RawContext>
Available on crate feature cl1_1
only.
pub fn raw_context(&self) -> Result<RawContext>
cl1_1
only.Return the context associated with event.
sourcepub fn profiling_nanos(&self) -> Result<ProfilingInfo<u64>>
pub fn profiling_nanos(&self) -> Result<ProfilingInfo<u64>>
Returns this event’s profiling info in u64
nanoseconds.
sourcepub fn profiling_time(&self) -> Result<ProfilingInfo<SystemTime>>
pub fn profiling_time(&self) -> Result<ProfilingInfo<SystemTime>>
Returns this event’s profiling info in SystemTime
.
sourcepub fn duration(&self) -> Result<Duration>
pub fn duration(&self) -> Result<Duration>
Returns the time elapsed between the event’s start and end.
sourcepub fn is_queued(&self) -> bool
pub fn is_queued(&self) -> bool
Returns true
if the status of the event is EventStatus::Queued
or an error, false
otherwise.
sourcepub fn has_submited(&self) -> bool
pub fn has_submited(&self) -> bool
Returns true
if the status of the event is EventStatus::Submitted
, EventStatus::Running
, EventStatus::Complete
or an error, false
otherwise.
sourcepub fn has_started_running(&self) -> bool
pub fn has_started_running(&self) -> bool
Returns true
if the status of the event is EventStatus::Running
, EventStatus::Complete
or an error, false
otherwise.
sourcepub fn has_completed(&self) -> bool
pub fn has_completed(&self) -> bool
Returns true
if the status of the event is EventStatus::Complete
or an error, false
otherwise.
pub fn get_info<T: Copy>(&self, id: cl_event_info) -> Result<T>
source§impl RawEvent
impl RawEvent
pub fn on_submit<T: 'static + Send>( &self, f: impl 'static + Send + FnOnce(RawEvent, Result<EventStatus>) -> T ) -> Result<CallbackHandle<T>>
cl1_1
only.pub fn on_run<T: 'static + Send>( &self, f: impl 'static + Send + FnOnce(RawEvent, Result<EventStatus>) -> T ) -> Result<CallbackHandle<T>>
cl1_1
only.pub fn on_complete<T: 'static + Send>( &self, f: impl 'static + Send + FnOnce(RawEvent, Result<EventStatus>) -> T ) -> Result<CallbackHandle<T>>
cl1_1
only.sourcepub fn on_status<T: 'static + Send>(
&self,
status: EventStatus,
f: impl 'static + Send + FnOnce(RawEvent, Result<EventStatus>) -> T
) -> Result<CallbackHandle<T>>
Available on crate feature cl1_1
only.
pub fn on_status<T: 'static + Send>( &self, status: EventStatus, f: impl 'static + Send + FnOnce(RawEvent, Result<EventStatus>) -> T ) -> Result<CallbackHandle<T>>
cl1_1
only.Adds a callback function that will be executed when the event reaches the specified status.
Unlike on_status_silent
, this method returns a CallbackHandle
that allows to wait for the callcack to execute and getting its result.
sourcepub fn on_submit_silent(
&self,
f: impl 'static + FnOnce(RawEvent, Result<EventStatus>) + Send
) -> Result<()>
Available on crate feature cl1_1
only.
pub fn on_submit_silent( &self, f: impl 'static + FnOnce(RawEvent, Result<EventStatus>) + Send ) -> Result<()>
cl1_1
only.Adds a callback function that will be executed when the event is submitted.
sourcepub fn on_run_silent(
&self,
f: impl 'static + FnOnce(RawEvent, Result<EventStatus>) + Send
) -> Result<()>
Available on crate feature cl1_1
only.
pub fn on_run_silent( &self, f: impl 'static + FnOnce(RawEvent, Result<EventStatus>) + Send ) -> Result<()>
cl1_1
only.Adds a callback function that will be executed when the event starts running.
sourcepub fn on_complete_silent(
&self,
f: impl 'static + FnOnce(RawEvent, Result<EventStatus>) + Send
) -> Result<()>
Available on crate feature cl1_1
only.
pub fn on_complete_silent( &self, f: impl 'static + FnOnce(RawEvent, Result<EventStatus>) + Send ) -> Result<()>
cl1_1
only.Adds a callback function that will be executed when the event completes.
sourcepub fn on_status_silent(
&self,
status: EventStatus,
f: impl 'static + FnOnce(RawEvent, Result<EventStatus>) + Send
) -> Result<()>
Available on crate feature cl1_1
only.
pub fn on_status_silent( &self, status: EventStatus, f: impl 'static + FnOnce(RawEvent, Result<EventStatus>) + Send ) -> Result<()>
cl1_1
only.Registers a user callback function for a specific command execution status.
The registered callback function will be called when the execution status of command associated with event changes to an execution status equal to or past the status specified by status
.
Each call to Event::on_status
registers the specified user callback function on a callback stack associated with event. The order in which the registered user callback functions are called is undefined.
All callbacks registered for an event object must be called before the event object is destroyed. Callbacks should return promptly.
Behavior is undefined when calling expensive system routines, OpenCL APIs to create contexts or command-queues, or blocking OpenCL APIs in an event callback. Rather than calling a blocking OpenCL API in an event callback, applications may call a non-blocking OpenCL API, then register a completion callback for the non-blocking OpenCL API with the remainder of the work.
Because commands in a command-queue are not required to begin execution until the command-queue is flushed, callbacks that enqueue commands on a command-queue should either call RawCommandQueue::flush
on the queue before returning, or arrange for the command-queue to be flushed later.
pub unsafe fn on_submit_raw( &self, f: unsafe extern "C" fn(event: cl_event, event_command_status: cl_int, user_data: *mut c_void), user_data: *mut c_void ) -> Result<()>
cl1_1
only.pub unsafe fn on_run_raw( &self, f: unsafe extern "C" fn(event: cl_event, event_command_status: cl_int, user_data: *mut c_void), user_data: *mut c_void ) -> Result<()>
cl1_1
only.pub unsafe fn on_complete_raw( &self, f: unsafe extern "C" fn(event: cl_event, event_command_status: cl_int, user_data: *mut c_void), user_data: *mut c_void ) -> Result<()>
cl1_1
only.pub unsafe fn on_status_raw( &self, status: EventStatus, f: unsafe extern "C" fn(event: cl_event, event_command_status: cl_int, user_data: *mut c_void), user_data: *mut c_void ) -> Result<()>
cl1_1
only.