[−][src]Struct ispc_rt::task::Context
A list of all task groups spawned by a function in some launch context which
will be sync'd at an explicit sync
call or function exit.
Note: A Context is done if and only if ISPCSync
has been called with
its handle and all of its tasks are finished. Until ISPCSync
is called on the
Context's handle more tasks could be launched.
Additionally, because we're not really able to associate a call to ISPCAlloc
with a specific Group care must be taken that the Context is not dropped
until ISPCSync
has been called on its handle and all Groups within have
completed execution.
Fields
id: usize
A unique identifier for this context
Methods
impl Context
[src]
pub fn new(id: usize) -> Context
[src]
Create a new list of tasks for some function with id id
pub fn launch(&self, total: (i32, i32, i32), data: *mut c_void, fcn: ISPCTaskFn)
[src]
Add a task group for execution that was launched in this context
pub fn current_tasks_done(&self) -> bool
[src]
Check if all tasks currently in the task list are completed
Note: A Context is done if and only if ISPCSync has been called with its handle and all of its tasks are finished. Until ISPCSync is called on the Context's handle more tasks could be launched. TODO: With this design we're essentially requiring the thread waiting on the context to busy wait since we provide no condition variable to block on.
pub unsafe fn alloc(&self, size: usize, align: usize) -> *mut c_void
[src]
Allocate some memory for this Context's task groups, returns a pointer to the allocated memory.
ⓘImportant traits for ContextIter<'a>pub fn iter(&self) -> ContextIter
[src]
An iterator over the current groups in the context which have remaining tasks to run on a thread. If more task groups are added before this iterator has returned None those will appear as well.
Trait Implementations
impl Drop for Context
[src]
fn drop(&mut self)
[src]
Release memory for all the tasks in this context
Note: that because we're not really able to associate a call to ISPCAlloc with a specific Group care must be taken that the Context is not dropped until ISPCSync has been called on its handle and all Groups within have completed execution.
impl Debug for Context
[src]
Auto Trait Implementations
impl Unpin for Context
impl Sync for Context
impl Send for Context
impl UnwindSafe for Context
impl RefUnwindSafe for Context
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,