Struct blaze_rs::event::RawEvent

source ·
#[repr(transparent)]
pub struct RawEvent(_);
Expand description

Raw OpenCL event

Implementations§

source§

impl RawEvent

source

pub const unsafe fn from_id_unchecked(inner: cl_event) -> Self

source

pub const unsafe fn from_id(inner: cl_event) -> Option<Self>

source

pub const fn id(&self) -> cl_event

source

pub unsafe fn retain(&self) -> Result<()>

source

pub fn join_by_ref(&self) -> Result<()>

source

pub fn join_all_by_ref(v: &[RawEvent]) -> Result<()>

Blocks the current thread until all the events have completed

source§

impl RawEvent

source

pub fn into_event(self) -> NoopEvent

Converts the RawEvent into a NoopEvent.

source

pub fn join_with_nanos_by_ref(self) -> Result<ProfilingInfo<u64>>

source

pub fn join_with_time_by_ref(self) -> Result<ProfilingInfo<SystemTime>>

source

pub fn join_with_duration_by_ref(self) -> Result<Duration>

source

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.

source

pub fn ty(&self) -> Result<CommandType>

Returns the event’s type

source

pub fn status(&self) -> Result<EventStatus>

Returns the event’s current status

source

pub fn command_queue(&self) -> Result<Option<RawCommandQueue>>

Returns the event’s underlying command queue

source

pub fn reference_count(&self) -> Result<u32>

source

pub fn raw_context(&self) -> Result<RawContext>

Available on crate feature cl1_1 only.

Return the context associated with event.

source

pub fn profiling_nanos(&self) -> Result<ProfilingInfo<u64>>

Returns this event’s profiling info in u64 nanoseconds.

source

pub fn profiling_time(&self) -> Result<ProfilingInfo<SystemTime>>

Returns this event’s profiling info in SystemTime.

source

pub fn duration(&self) -> Result<Duration>

Returns the time elapsed between the event’s start and end.

source

pub fn is_queued(&self) -> bool

Returns true if the status of the event is EventStatus::Queued or an error, false otherwise.

source

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.

source

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.

source

pub fn has_completed(&self) -> bool

Returns true if the status of the event is EventStatus::Complete or an error, false otherwise.

source

pub fn get_info<T: Copy>(&self, id: cl_event_info) -> Result<T>

source§

impl RawEvent

source

pub fn on_submit<T: 'static + Send>( &self, f: impl 'static + Send + FnOnce(RawEvent, Result<EventStatus>) -> T ) -> Result<CallbackHandle<T>>

Available on crate feature cl1_1 only.
source

pub fn on_run<T: 'static + Send>( &self, f: impl 'static + Send + FnOnce(RawEvent, Result<EventStatus>) -> T ) -> Result<CallbackHandle<T>>

Available on crate feature cl1_1 only.
source

pub fn on_complete<T: 'static + Send>( &self, f: impl 'static + Send + FnOnce(RawEvent, Result<EventStatus>) -> T ) -> Result<CallbackHandle<T>>

Available on crate feature cl1_1 only.
source

pub 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.

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.

source

pub fn on_submit_silent( &self, f: impl 'static + FnOnce(RawEvent, Result<EventStatus>) + Send ) -> Result<()>

Available on crate feature cl1_1 only.

Adds a callback function that will be executed when the event is submitted.

source

pub fn on_run_silent( &self, f: impl 'static + FnOnce(RawEvent, Result<EventStatus>) + Send ) -> Result<()>

Available on crate feature cl1_1 only.

Adds a callback function that will be executed when the event starts running.

source

pub fn on_complete_silent( &self, f: impl 'static + FnOnce(RawEvent, Result<EventStatus>) + Send ) -> Result<()>

Available on crate feature cl1_1 only.

Adds a callback function that will be executed when the event completes.

source

pub fn on_status_silent( &self, status: EventStatus, f: impl 'static + FnOnce(RawEvent, Result<EventStatus>) + Send ) -> Result<()>

Available on crate feature 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.

source

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<()>

Available on crate feature cl1_1 only.
source

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<()>

Available on crate feature cl1_1 only.
source

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<()>

Available on crate feature cl1_1 only.
source

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<()>

Available on crate feature cl1_1 only.

Trait Implementations§

source§

impl Clone for RawEvent

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RawEvent

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for RawEvent

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Hash for RawEvent

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Into<Event<Noop>> for RawEvent

source§

fn into(self) -> NoopEvent

Converts this type into the (usually inferred) input type.
source§

impl PartialEq<RawEvent> for RawEvent

source§

fn eq(&self, other: &RawEvent) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for RawEvent

source§

impl Send for RawEvent

source§

impl StructuralEq for RawEvent

source§

impl StructuralPartialEq for RawEvent

source§

impl Sync for RawEvent

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.