pub enum ExecutionPolicy {
CpuSingle,
CpuParallel,
Gpu(DeviceKind),
Auto,
}Expand description
Execution policy for spatial algorithms.
Variants§
CpuSingle
Single-threaded CPU execution.
CpuParallel
Parallel CPU execution.
Gpu(DeviceKind)
GPU execution on a device of the given kind.
Auto
Automatic selection based on runtime heuristics.
Implementations§
Source§impl ExecutionPolicy
impl ExecutionPolicy
Sourcepub fn validate(self) -> SpatialResult<()>
pub fn validate(self) -> SpatialResult<()>
Validates that the policy names a meaningful execution request.
Sourcepub const fn is_explicit(self) -> bool
pub const fn is_explicit(self) -> bool
Returns whether the policy names a concrete execution backend.
Sourcepub const fn requests_gpu(self) -> bool
pub const fn requests_gpu(self) -> bool
Returns whether the policy requests an accelerator backend.
Sourcepub const fn allows_fallback(self) -> bool
pub const fn allows_fallback(self) -> bool
Returns whether the policy lets an algorithm choose a fallback backend.
Auto is the only policy with fallback semantics. An explicit CPU or GPU
policy is a request for that backend and must be reported as unsupported
when the backend cannot satisfy it.
Sourcepub const fn device_kind(&self) -> Option<DeviceKind>
pub const fn device_kind(&self) -> Option<DeviceKind>
Returns the device kind targeted by this policy when known.
Trait Implementations§
Source§impl Clone for ExecutionPolicy
impl Clone for ExecutionPolicy
Source§fn clone(&self) -> ExecutionPolicy
fn clone(&self) -> ExecutionPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExecutionPolicy
impl Debug for ExecutionPolicy
Source§impl Default for ExecutionPolicy
impl Default for ExecutionPolicy
Source§fn default() -> ExecutionPolicy
fn default() -> ExecutionPolicy
Returns the “default value” for a type. Read more
Source§impl Hash for ExecutionPolicy
impl Hash for ExecutionPolicy
Source§impl PartialEq for ExecutionPolicy
impl PartialEq for ExecutionPolicy
Source§fn eq(&self, other: &ExecutionPolicy) -> bool
fn eq(&self, other: &ExecutionPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Copy for ExecutionPolicy
impl Eq for ExecutionPolicy
impl StructuralPartialEq for ExecutionPolicy
Auto Trait Implementations§
impl Freeze for ExecutionPolicy
impl RefUnwindSafe for ExecutionPolicy
impl Send for ExecutionPolicy
impl Sync for ExecutionPolicy
impl Unpin for ExecutionPolicy
impl UnsafeUnpin for ExecutionPolicy
impl UnwindSafe for ExecutionPolicy
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