pub enum CpuThreadError {
ZeroThreads,
Pool {
source: Box<Error>,
},
EmptyCpuList,
DuplicateCpu {
cpu: usize,
},
CpuNotAllowed {
cpu: usize,
},
UnsupportedPlatform,
Affinity {
operation: &'static str,
source: Error,
},
ConstructionThread {
source: Error,
},
ConstructionThreadPanic,
WorkerAffinity {
worker: usize,
source: Error,
},
}Expand description
Failure reported when building a CpuBackend pool or applying its
affinity policy.
A pool build and, on Linux, the affinity snapshot are the fallible steps of a
CpuBackend: tenferro itself never builds threads, so the caller’s thread
policy is the caller’s error to
carry.
§Examples
use tensor4all_tensorbackend::CpuThreadError;
let error = CpuThreadError::ZeroThreads;
assert!(error.to_string().contains("at least one"));Variants§
ZeroThreads
A CpuBackend was asked for zero workers.
Pool
The worker pool for the requested worker count could not be built.
EmptyCpuList
CpuBackend::pinned was given an empty CPU list.
DuplicateCpu
CpuBackend::pinned was given the same CPU twice.
CpuNotAllowed
CpuBackend::pinned named a CPU outside the main thread’s mask.
UnsupportedPlatform
CPU affinity is only implemented on Linux.
Affinity
An affinity system call failed.
Fields
ConstructionThread
The short-lived thread that builds a pool could not be started.
ConstructionThreadPanic
The CPU pool construction thread panicked before returning the pool.
WorkerAffinity
A pinned worker could not be confined to its CPU, or its startup handshake failed.
Trait Implementations§
Source§impl Debug for CpuThreadError
impl Debug for CpuThreadError
Source§impl Display for CpuThreadError
impl Display for CpuThreadError
Source§impl Error for CpuThreadError
impl Error for CpuThreadError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for CpuThreadError
impl !UnwindSafe for CpuThreadError
impl Freeze for CpuThreadError
impl Send for CpuThreadError
impl Sync for CpuThreadError
impl Unpin for CpuThreadError
impl UnsafeUnpin for CpuThreadError
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
impl<T, U> Imply<T> for U
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