pub struct Parallel { /* private fields */ }Expand description
A multithreaded execution environment for the tasks launched in ISPC
Implementations§
Source§impl Parallel
impl Parallel
Sourcepub fn new() -> Arc<Parallel>
pub fn new() -> Arc<Parallel>
Create a parallel task execution environment that will use num_cpus threads
to run tasks.
Sourcepub fn oversubscribed(oversubscribe: f32) -> Arc<Parallel>
pub fn oversubscribed(oversubscribe: f32) -> Arc<Parallel>
Create an oversubscribued parallel task execution environment that will use
oversubscribe * num_cpus threads to run tasks.
Trait Implementations§
Source§impl TaskSystem for Parallel
impl TaskSystem for Parallel
Source§unsafe fn alloc(
&self,
handle_ptr: *mut *mut c_void,
size: i64,
align: i32,
) -> *mut c_void
unsafe fn alloc( &self, handle_ptr: *mut *mut c_void, size: i64, align: i32, ) -> *mut c_void
Alloc is called when memory must be allocated to store parameters to pass to a task
and must return a pointer to an allocation of
size bytes aligned to align. Read moreSource§unsafe fn launch(
&self,
handle_ptr: *mut *mut c_void,
f: extern "C" fn(*mut c_void, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32),
data: *mut c_void,
count0: i32,
count1: i32,
count2: i32,
)
unsafe fn launch( &self, handle_ptr: *mut *mut c_void, f: extern "C" fn(*mut c_void, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32), data: *mut c_void, count0: i32, count1: i32, count2: i32, )
Launch is called when a new group of tasks is being launched and should schedule them to
be executed in some way. Read more
Auto Trait Implementations§
impl !Freeze for Parallel
impl RefUnwindSafe for Parallel
impl Send for Parallel
impl Sync for Parallel
impl Unpin for Parallel
impl UnwindSafe for Parallel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more