pub struct ComputePolicy { /* private fields */ }Expand description
The shared compute policy: a measured per-class matrix plus the host’s
precision/VRAM envelope. Built once at startup; select is the hot, O(1) call.
Implementations§
Source§impl ComputePolicy
impl ComputePolicy
Sourcepub fn from_class_matrix(
matrix: ClassMatrix,
budget: PowerThermalBudget,
host: HostCapabilities,
) -> Self
pub fn from_class_matrix( matrix: ClassMatrix, budget: PowerThermalBudget, host: HostCapabilities, ) -> Self
Build from an already-measured per-class matrix (e.g. one loaded from the passport, or a synthetic one in tests — no GPU required).
Sourcepub fn probe(
registry: &BackendRegistry,
panel: &KernelPanel,
budget: PowerThermalBudget,
host: HostCapabilities,
) -> Self
pub fn probe( registry: &BackendRegistry, panel: &KernelPanel, budget: PowerThermalBudget, host: HostCapabilities, ) -> Self
Probe the registry once (heavy) and build the policy. Call at startup; cache the matrix in the passport to avoid re-probing every boot.
Sourcepub fn matrix(&self) -> &ClassMatrix
pub fn matrix(&self) -> &ClassMatrix
The measured per-class matrix (for inspection / passport caching).
Sourcepub fn select(&self, class: KernelClass, problem_bytes: u64) -> Plan
pub fn select(&self, class: KernelClass, problem_bytes: u64) -> Plan
Select the execution plan for a class kernel touching problem_bytes of
data. O(1), zero-heap, never fails: returns a CPU plan when no accelerator
wins, when no GPU was probed, or when the measured GPU win is within noise of
CPU for a class that is not typically GPU-amenable (the §13 tie-break — a
measured GPU win on an amenable class is always honoured).
Auto Trait Implementations§
impl Freeze for ComputePolicy
impl RefUnwindSafe for ComputePolicy
impl Send for ComputePolicy
impl Sync for ComputePolicy
impl Unpin for ComputePolicy
impl UnsafeUnpin for ComputePolicy
impl UnwindSafe for ComputePolicy
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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