pub struct Parallelism { /* private fields */ }
Expand description
Specifies data parallelism settings.
Implementations§
Source§impl Parallelism
impl Parallelism
Sourcepub fn new(num_thread_pools: usize, threads_per_pool: usize) -> Parallelism
pub fn new(num_thread_pools: usize, threads_per_pool: usize) -> Parallelism
Creates an instance of Parallelism
.
Sourcepub fn new_with_cpus(available_cpus: usize) -> Parallelism
pub fn new_with_cpus(available_cpus: usize) -> Parallelism
Creates an instance of Parallelism
using available cpus as given.
Sourcepub fn available_cpus(&self) -> usize
pub fn available_cpus(&self) -> usize
Amount of total available CPUs.
Sourcepub fn thread_pool_execute<OP, R>(&self, idx: usize, op: OP) -> R
pub fn thread_pool_execute<OP, R>(&self, idx: usize, op: OP) -> R
Executes operation on thread pool with given index. If there is no thread pool with such an index, then execute it without using any of thread pools.
Sourcepub fn thread_pool_size(&self) -> usize
pub fn thread_pool_size(&self) -> usize
Returns number of non-default thread pools. Returns zero if only default thread pool is used.
Trait Implementations§
Source§impl Clone for Parallelism
impl Clone for Parallelism
Source§fn clone(&self) -> Parallelism
fn clone(&self) -> Parallelism
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Default for Parallelism
impl Default for Parallelism
Source§fn default() -> Parallelism
fn default() -> Parallelism
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Parallelism
impl !RefUnwindSafe for Parallelism
impl Send for Parallelism
impl Sync for Parallelism
impl Unpin for Parallelism
impl !UnwindSafe for Parallelism
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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