pub struct CpuExecution { /* private fields */ }Expand description
CPU execution context with runtime ISA detection and, with parallel, a
local pool of exactly Self::thread_count workers.
This type deliberately implements no geometry operation trait. A provider
only implements MeshBoolean, MeshCompiler, or another capability
after the algorithm exists and is verified.
Implementations§
Source§impl CpuExecution
impl CpuExecution
Sourcepub fn portable() -> CpuExecution
pub fn portable() -> CpuExecution
Always-available portable execution context.
Sourcepub fn detect() -> CpuExecution
pub fn detect() -> CpuExecution
Best instruction path compiled into this binary and available at runtime.
Sourcepub const fn instruction_set(&self) -> CpuInstructionSet
pub const fn instruction_set(&self) -> CpuInstructionSet
Runtime-selected instruction set.
Sourcepub const fn features(&self) -> CpuFeatures
pub const fn features(&self) -> CpuFeatures
Detected machine features.
Sourcepub const fn thread_count(&self) -> NonZero<usize>
pub const fn thread_count(&self) -> NonZero<usize>
Configured worker bound.
Sourcepub fn install<R>(&self, operation: impl FnOnce() -> R + Send) -> Rwhere
R: Send,
pub fn install<R>(&self, operation: impl FnOnce() -> R + Send) -> Rwhere
R: Send,
Execute one closure inside this context’s local Rayon pool, which has
exactly Self::thread_count workers, one included: inside it
rayon::current_num_threads() is that count, whatever pool the
caller runs in.
§Panics
For a context from Self::portable or Self::detect, the pool
is started on first use, and this panics if the operating system
refuses the thread, as a first use of Rayon’s global pool does. A
context from crate::CpuExecutionBuilder started its pool when it
was built and reported a failure there.
Trait Implementations§
Source§impl Clone for CpuExecution
impl Clone for CpuExecution
Source§fn clone(&self) -> CpuExecution
fn clone(&self) -> CpuExecution
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for CpuExecution
impl !UnwindSafe for CpuExecution
impl Freeze for CpuExecution
impl Send for CpuExecution
impl Sync for CpuExecution
impl Unpin for CpuExecution
impl UnsafeUnpin for CpuExecution
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
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