Event

Struct Event 

Source
pub struct Event { /* private fields */ }
Expand description

An OpenCL event object.

Has methods to return information from calls to clGetEventInfo and clGetEventProfilingInfo with the appropriate parameters.
Implements the Drop trait to call release_event when the object is dropped.

Implementations§

Source§

impl Event

Source

pub const fn new(event: cl_event) -> Self

Create an Event from an OpenCL cl_event.

  • event - a valid OpenCL cl_event.

returns the new Event

Source

pub const fn get(&self) -> cl_event

Get the underlying OpenCL cl_event.

Source

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

Wait for the event to complete.

Source

pub fn command_execution_status(&self) -> Result<CommandExecutionStatus>

Source

pub fn command_type(&self) -> Result<EventCommandType>

Source

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

Source

pub fn command_queue(&self) -> Result<cl_command_queue>

Source

pub fn context(&self) -> Result<cl_context>

Source

pub fn get_data(&self, param_name: cl_event_info) -> Result<Vec<u8>>

Get data about an OpenCL event. Calls clGetEventInfo to get the desired data about the event.

Source

pub fn set_callback( &self, command_exec_callback_type: cl_int, pfn_notify: extern "C" fn(cl_event, cl_int, *mut c_void), user_data: *mut c_void, ) -> Result<()>

Source

pub fn profiling_command_queued(&self) -> Result<cl_ulong>

Source

pub fn profiling_command_submit(&self) -> Result<cl_ulong>

Source

pub fn profiling_command_start(&self) -> Result<cl_ulong>

Source

pub fn profiling_command_end(&self) -> Result<cl_ulong>

Source

pub fn profiling_command_complete(&self) -> Result<cl_ulong>

CL_VERSION_2_0

Source

pub fn profiling_data(&self, param_name: cl_profiling_info) -> Result<Vec<u8>>

Get profiling data about an OpenCL event. Calls clGetEventProfilingInfo to get the desired profiling data about the event.

Trait Implementations§

Source§

impl Debug for Event

Source§

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

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

impl Drop for Event

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl From<*mut c_void> for Event

Source§

fn from(event: cl_event) -> Self

Converts to this type from the input type.
Source§

impl From<Event> for cl_event

Source§

fn from(value: Event) -> Self

Converts to this type from the input type.
Source§

impl Send for Event

Source§

impl Sync for Event

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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.

Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.