Struct fil_ocl::Event[][src]

#[repr(C)]
#[must_use = "futures do nothing unless polled"]pub struct Event(_);

An event representing a command or user created event.

Implementations

impl Event[src]

pub fn empty() -> Event[src]

Creates a new, empty (null) event which must be filled by a command, associating the event with it.

pub fn user<C: ClContextPtr>(context: C) -> OclResult<Event>[src]

Creates a new, empty event which must be filled by a newly initiated command, associating the event with it.

pub fn is_empty(&self) -> bool[src]

Returns true if this event is ‘empty’ and has not yet been associated with a command.

pub fn set_unpark_callback(&self) -> OclResult<()>[src]

Sets a callback function to trigger upon completion of this event which will unpark the current task.

To be used within the context of a futures task.

Panics

This function will panic if a task is not currently being executed. That is, this method can be dangerous to call outside of an implementation of poll.

pub unsafe fn register_event_relay(&self, user_event: Event) -> OclResult<()>[src]

Registers a user event to have its status set to complete (CommandExecutionStatus::Complete) immediately upon completion of this event.

Deadlocks

Due to the nature of OpenCL queue implementations, care must be taken when using this function. OpenCL queue deadlocks may occur.

OpenCL queues generally use one thread per queue for the purposes of callbacks, etc. As a rule of thumb, ensure that any OpenCL commands preceding the causation/source event (self) are in a separate queue from any commands with the dependent/target event (user_event).

Safety

The caller must ensure that user_event was created with Event::user() and that it’s status is CommandExecutionStatus::Submitted (the default upon creation).

pub fn info(&self, info_kind: EventInfo) -> OclResult<EventInfoResult>[src]

Returns info about the event.

pub fn profiling_info(
    &self,
    info_kind: ProfilingInfo
) -> OclResult<ProfilingInfoResult>
[src]

Returns info about the event.

pub fn queue_core(&self) -> OclResult<CommandQueueCore>[src]

Returns this event’s associated command queue.

pub fn as_core(&self) -> &EventCore[src]

Returns a reference to the core pointer wrapper, usable by functions in the core module.

pub fn into_raw(self) -> cl_event[src]

Consumes the Event, returning the wrapped cl_event pointer.

To avoid a memory leak the pointer must be converted back to an Event using Event::from_raw.

pub unsafe fn from_raw(ptr: cl_event) -> Event[src]

Constructs an Event from a raw cl_event pointer.

The raw pointer must have been previously returned by a call to a Event::into_raw.

Methods from Deref<Target = EventCore>

pub fn set_complete(&self) -> Result<(), Error>[src]

Sets this user created event to CommandExecutionStatus::Complete.

Will return an error if this event is not a ‘user’ event (created with ::user()).

pub fn is_complete(&self) -> Result<bool, Error>[src]

Queries the command status associated with this event and returns true if it is complete, false if incomplete or upon error.

This is the fastest possible way to determine event status.

pub fn wait_for(&self) -> Result<(), Error>[src]

Causes the command queue to wait until this event is complete before returning.

pub fn is_null(&self) -> bool[src]

Returns whether or not this event is associated with a command or is a user event.

pub fn is_valid(&self) -> bool[src]

[FIXME]: ADD VALIDITY CHECK BY CALLING ‘_INFO’ OR SOMETHING: NULL CHECK IS NOT ENOUGH

This still leads to crazy segfaults when non-event pointers (random whatever addresses) are passed. Need better check.

pub unsafe fn set_callback(
    &self,
    callback_receiver: extern "C" fn(*mut c_void, i32, *mut c_void),
    user_data_ptr: *mut c_void
) -> Result<(), Error>
[src]

Sets a callback function, callback_receiver, to trigger upon completion of this event with an optional pointer to user data.

The callback function must have a signature matching: extern "C" fn (ffi::cl_event, i32, *mut libc::c_void)

Safety

user_data must be guaranteed to still exist if and when callback_receiver is ever called.

TODO: Create a safer type wrapper for callback_receiver (using an Arc?, etc.) within ocl.

pub fn context(&self) -> Result<Context, Error>[src]

Returns the Context associated with this event.

pub unsafe fn as_ptr_ref(&self) -> &*mut c_void[src]

Returns an immutable reference to a pointer, do not deref and store it unless you will manage its associated reference count carefully.

Warning

DO NOT store this pointer.

DO NOT send this pointer across threads unless you are incrementing the reference count before sending and decrementing after sending.

Use ::into_raw for these purposes. Thank you.

pub unsafe fn as_ptr_mut(&mut self) -> &mut *mut c_void[src]

Returns a mutable reference to a pointer, do not deref then modify or store it unless you will manage its associated reference count carefully.

Warning

DO NOT store this pointer.

DO NOT send this pointer across threads unless you are incrementing the reference count before sending and decrementing after sending.

Use ::into_raw for these purposes. Thank you.

Trait Implementations

impl AsRef<Event> for Event[src]

impl<'e> ClEventPtrRef<'e> for Event[src]

impl<'a> ClNullEventPtr for &'a mut Event[src]

impl ClWaitListPtr for Event[src]

impl<'a> ClWaitListPtr for &'a Event[src]

impl Clone for Event[src]

impl Debug for Event[src]

impl Default for Event[src]

impl Deref for Event[src]

type Target = EventCore

The resulting type after dereferencing.

impl DerefMut for Event[src]

impl Display for Event[src]

impl Eq for Event[src]

impl<'a> From<&'a Event> for ClWaitListPtrEnum<'a>[src]

impl<'a> From<&'a mut Event> for ClWaitListPtrEnum<'a>[src]

impl<'a> From<&'a mut Event> for ClNullEventPtrEnum<'a>[src]

impl From<Event> for Event[src]

impl From<Event> for EventCore[src]

impl<'a> From<Event> for EventArray[src]

impl<'a> From<Event> for EventList[src]

impl<'a> From<Event> for ClWaitListPtrEnum<'a>[src]

impl Future for Event[src]

type Item = ()

The type of value that this future will resolved with if it is successful. Read more

type Error = OclError

The type of error that this future will resolve with if it fails in a normal fashion. Read more

impl Hash for Event[src]

impl PartialEq<Event> for Event[src]

impl StructuralEq for Event[src]

impl StructuralPartialEq for Event[src]

Auto Trait Implementations

impl RefUnwindSafe for Event

impl Send for Event

impl Sync for Event

impl Unpin for Event

impl UnwindSafe for Event

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<F> IntoFuture for F where
    F: Future
[src]

type Future = F

The future that this type can be converted into.

type Item = <F as Future>::Item

The item that the future may resolve with.

type Error = <F as Future>::Error

The error that the future may resolve with.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.