Struct ocl::Event[][src]

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

An event representing a command or user created event.

Methods

impl Event
[src]

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

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

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

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.

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

Returns info about the event.

Returns info about the event.

Returns this event's associated command queue.

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

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.

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>

Sets this user created event to CommandExecutionStatus::Complete.

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

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.

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

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

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

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.

Returns the Context associated with this event.

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.

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 Clone for Event
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Event
[src]

Formats the value using the given formatter. Read more

impl Hash for Event
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl PartialEq for Event
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Event
[src]

impl From<EventCore> for Event
[src]

Performs the conversion.

impl From<Event> for EventCore
[src]

Performs the conversion.

impl Default for Event
[src]

Returns the "default value" for a type. Read more

impl Deref for Event
[src]

The resulting type after dereferencing.

Dereferences the value.

impl DerefMut for Event
[src]

Mutably dereferences the value.

impl AsRef<EventCore> for Event
[src]

Performs the conversion.

impl Display for Event
[src]

Formats the value using the given formatter. Read more

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

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

impl ClWaitListPtr for Event
[src]

Returns a pointer to the first pointer in this list.

Returns the number of items in this wait list.

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

Returns a pointer to the first pointer in this list.

Returns the number of items in this wait list.

impl Future for Event
[src]

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

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

Query this future to see if its value has become available, registering interest if it is not. Read more

Block the current thread until this future is resolved. Read more

Map this future's result to a different type, returning a new future of the resulting type. Read more

Map this future's error to a different error, returning a new future. Read more

Map this future's error to any error implementing From for this future's Error, returning a new future. Read more

Chain on a computation for when a future finished, passing the result of the future to the provided closure f. Read more

Execute another future after this one has resolved successfully. Read more

Execute another future if this one resolves with an error. Read more

Waits for either one of two futures to complete. Read more

Waits for either one of two differently-typed futures to complete. Read more

Joins the result of two futures, waiting for them both to complete. Read more

Same as join, but with more futures.

Same as join, but with more futures.

Same as join, but with more futures.

Convert this future into a single element stream. Read more

Flatten the execution of this future when the successful result of this future is itself another future. Read more

Flatten the execution of this future when the successful result of this future is a stream. Read more

Fuse a future such that poll will never again be called once it has completed. Read more

Do something with the item of a future, passing it on. Read more

Catches unwinding panics while polling the future. Read more

Create a cloneable handle to this future where all handles will resolve to the same result. Read more

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

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

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

Performs the conversion.

Auto Trait Implementations

impl Send for Event

impl Sync for Event