Enum CpuBatchStrategy
#[non_exhaustive]pub enum CpuBatchStrategy {
Auto,
Sequential,
Outer,
Inner,
Split {
lanes: NonZero<usize>,
},
}Expand description
How the items of one batched operation are split over a thread budget.
This is tcontract_exec::BatchStrategy. The old OuterParallel variant is
CpuBatchStrategy::Outer and the old ProviderItems variant is
CpuBatchStrategy::Inner; Sequential and Auto kept their names.
§Examples
use tenferro_cpu::CpuBatchStrategy;
assert_eq!(CpuBatchStrategy::default(), CpuBatchStrategy::Auto);How the items of a batch are split over a thread budget.
§Examples
use tcontract_exec::batch::BatchStrategy;
assert_eq!(BatchStrategy::default(), BatchStrategy::Auto);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Auto
Choose from the WorkModel and the query’s route capabilities.
Sequential
One lane, one item thread: no parallelism at all.
Outer
lanes = min(budget, items), each item serial.
Inner
One lane; the item kernel gets the whole budget.
Split
Exactly lanes lanes (clamped to the items and the budget), the rest
of the budget split evenly as item threads. A route that cannot run item
threads inside a lane refuses the resulting decision with
[crate::ExecError::StrategyUnavailable] before any write; it never silently
runs the items serially (see [BatchDecision]’s route contract).
Trait Implementations§
§impl Clone for BatchStrategy
impl Clone for BatchStrategy
§fn clone(&self) -> BatchStrategy
fn clone(&self) -> BatchStrategy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for BatchStrategy
§impl Debug for BatchStrategy
impl Debug for BatchStrategy
§impl Default for BatchStrategy
impl Default for BatchStrategy
§fn default() -> BatchStrategy
fn default() -> BatchStrategy
impl Eq for BatchStrategy
§impl PartialEq for BatchStrategy
impl PartialEq for BatchStrategy
impl StructuralPartialEq for BatchStrategy
Auto Trait Implementations§
impl Freeze for BatchStrategy
impl RefUnwindSafe for BatchStrategy
impl Send for BatchStrategy
impl Sync for BatchStrategy
impl Unpin for BatchStrategy
impl UnsafeUnpin for BatchStrategy
impl UnwindSafe for BatchStrategy
Blanket Implementations§
impl<T> Boilerplate for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
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