Struct fil_ocl::Event [−][src]
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]
&self,
info_kind: ProfilingInfo
) -> OclResult<ProfilingInfoResult>
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]
&self,
callback_receiver: extern "C" fn(*mut c_void, i32, *mut c_void),
user_data_ptr: *mut c_void
) -> Result<(), Error>
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]
unsafe fn as_ptr_ref(&'e self) -> &'e cl_event
[src]
impl<'a> ClNullEventPtr for &'a mut Event
[src]
fn alloc_new(&mut self) -> *mut cl_event
[src]
unsafe fn clone_from<E: AsRef<EventCore>>(&mut self, ev: E)
[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]
impl DerefMut for Event
[src]
impl Display for Event
[src]
impl Eq for Event
[src]
impl<'a> From<&'a Event> for ClWaitListPtrEnum<'a>
[src]
fn from(e: &'a Event) -> ClWaitListPtrEnum<'a>
[src]
impl<'a> From<&'a mut Event> for ClWaitListPtrEnum<'a>
[src]
fn from(e: &'a mut Event) -> ClWaitListPtrEnum<'a>
[src]
impl<'a> From<&'a mut Event> for ClNullEventPtrEnum<'a>
[src]
fn from(e: &'a mut Event) -> ClNullEventPtrEnum<'a>
[src]
impl From<Event> for Event
[src]
impl From<Event> for EventCore
[src]
impl<'a> From<Event> for EventArray
[src]
fn from(event: Event) -> EventArray
[src]
impl<'a> From<Event> for EventList
[src]
impl<'a> From<Event> for ClWaitListPtrEnum<'a>
[src]
fn from(e: Event) -> 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
fn poll(&mut self) -> Poll<Self::Item, Self::Error>
[src]
pub fn wait(self) -> Result<Self::Item, Self::Error>
[src]
pub fn map<F, U>(self, f: F) -> Map<Self, F> where
F: FnOnce(Self::Item) -> U,
[src]
F: FnOnce(Self::Item) -> U,
pub fn map_err<F, E>(self, f: F) -> MapErr<Self, F> where
F: FnOnce(Self::Error) -> E,
[src]
F: FnOnce(Self::Error) -> E,
pub fn from_err<E>(self) -> FromErr<Self, E> where
E: From<Self::Error>,
[src]
E: From<Self::Error>,
pub fn then<F, B>(self, f: F) -> Then<Self, B, F> where
B: IntoFuture,
F: FnOnce(Result<Self::Item, Self::Error>) -> B,
[src]
B: IntoFuture,
F: FnOnce(Result<Self::Item, Self::Error>) -> B,
pub fn and_then<F, B>(self, f: F) -> AndThen<Self, B, F> where
B: IntoFuture<Error = Self::Error>,
F: FnOnce(Self::Item) -> B,
[src]
B: IntoFuture<Error = Self::Error>,
F: FnOnce(Self::Item) -> B,
pub fn or_else<F, B>(self, f: F) -> OrElse<Self, B, F> where
B: IntoFuture<Item = Self::Item>,
F: FnOnce(Self::Error) -> B,
[src]
B: IntoFuture<Item = Self::Item>,
F: FnOnce(Self::Error) -> B,
pub fn select<B>(self, other: B) -> Select<Self, <B as IntoFuture>::Future> where
B: IntoFuture<Item = Self::Item, Error = Self::Error>,
[src]
B: IntoFuture<Item = Self::Item, Error = Self::Error>,
pub fn select2<B>(self, other: B) -> Select2<Self, <B as IntoFuture>::Future> where
B: IntoFuture,
[src]
B: IntoFuture,
pub fn join<B>(self, other: B) -> Join<Self, <B as IntoFuture>::Future> where
B: IntoFuture<Error = Self::Error>,
[src]
B: IntoFuture<Error = Self::Error>,
pub fn join3<B, C>(
self,
b: B,
c: C
) -> Join3<Self, <B as IntoFuture>::Future, <C as IntoFuture>::Future> where
C: IntoFuture<Error = Self::Error>,
B: IntoFuture<Error = Self::Error>,
[src]
self,
b: B,
c: C
) -> Join3<Self, <B as IntoFuture>::Future, <C as IntoFuture>::Future> where
C: IntoFuture<Error = Self::Error>,
B: IntoFuture<Error = Self::Error>,
pub fn join4<B, C, D>(
self,
b: B,
c: C,
d: D
) -> Join4<Self, <B as IntoFuture>::Future, <C as IntoFuture>::Future, <D as IntoFuture>::Future> where
C: IntoFuture<Error = Self::Error>,
D: IntoFuture<Error = Self::Error>,
B: IntoFuture<Error = Self::Error>,
[src]
self,
b: B,
c: C,
d: D
) -> Join4<Self, <B as IntoFuture>::Future, <C as IntoFuture>::Future, <D as IntoFuture>::Future> where
C: IntoFuture<Error = Self::Error>,
D: IntoFuture<Error = Self::Error>,
B: IntoFuture<Error = Self::Error>,
pub fn join5<B, C, D, E>(
self,
b: B,
c: C,
d: D,
e: E
) -> Join5<Self, <B as IntoFuture>::Future, <C as IntoFuture>::Future, <D as IntoFuture>::Future, <E as IntoFuture>::Future> where
C: IntoFuture<Error = Self::Error>,
E: IntoFuture<Error = Self::Error>,
D: IntoFuture<Error = Self::Error>,
B: IntoFuture<Error = Self::Error>,
[src]
self,
b: B,
c: C,
d: D,
e: E
) -> Join5<Self, <B as IntoFuture>::Future, <C as IntoFuture>::Future, <D as IntoFuture>::Future, <E as IntoFuture>::Future> where
C: IntoFuture<Error = Self::Error>,
E: IntoFuture<Error = Self::Error>,
D: IntoFuture<Error = Self::Error>,
B: IntoFuture<Error = Self::Error>,
pub fn into_stream(self) -> IntoStream<Self>
[src]
pub fn flatten(self) -> Flatten<Self> where
Self::Item: IntoFuture,
<Self::Item as IntoFuture>::Error: From<Self::Error>,
[src]
Self::Item: IntoFuture,
<Self::Item as IntoFuture>::Error: From<Self::Error>,
pub fn flatten_stream(self) -> FlattenStream<Self> where
Self::Item: Stream,
<Self::Item as Stream>::Error == Self::Error,
[src]
Self::Item: Stream,
<Self::Item as Stream>::Error == Self::Error,
pub fn fuse(self) -> Fuse<Self>
[src]
pub fn inspect<F>(self, f: F) -> Inspect<Self, F> where
F: FnOnce(&Self::Item),
[src]
F: FnOnce(&Self::Item),
pub fn catch_unwind(self) -> CatchUnwind<Self> where
Self: UnwindSafe,
[src]
Self: UnwindSafe,
pub fn shared(self) -> Shared<Self>
[src]
impl Hash for Event
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<F> IntoFuture for F where
F: Future,
[src]
F: Future,
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.
pub fn into_future(self) -> F
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,