pub struct CpuBackend;Expand description
Prepares compiled models for CPU execution.
Implementations§
Source§impl CpuBackend
impl CpuBackend
Sourcepub fn prepare_for_execution(
&self,
model: &CompiledModel,
execution: &Execution,
) -> RuntimeResult<CpuPlan>
pub fn prepare_for_execution( &self, model: &CompiledModel, execution: &Execution, ) -> RuntimeResult<CpuPlan>
Prepares a model using the policies resolved by an execution context.
§Errors
Returns RuntimeError when model lowering or differentiation fails,
or the requested precision is unsupported for the model.
Sourcepub fn prepare(&self, model: &CompiledModel) -> CpuPlan
pub fn prepare(&self, model: &CompiledModel) -> CpuPlan
Prepares a model with forward autodiff and automatic execution-mode selection.
§Panics
Panics if forward differentiation or executable-plan construction fails for the compiled model.
Sourcepub fn prepare_with_execution_mode(
&self,
model: &CompiledModel,
execution_mode: CpuExecutionMode,
) -> CpuPlan
pub fn prepare_with_execution_mode( &self, model: &CompiledModel, execution_mode: CpuExecutionMode, ) -> CpuPlan
Prepares a model with an explicit scalar-kernel execution mode.
§Panics
Panics if forward differentiation or executable-plan construction fails for the compiled model.
Sourcepub fn prepare_with_autodiff_mode(
&self,
model: &CompiledModel,
mode: AutodiffMode,
) -> AutodiffResult<CpuPlan>
pub fn prepare_with_autodiff_mode( &self, model: &CompiledModel, mode: AutodiffMode, ) -> AutodiffResult<CpuPlan>
Prepares a model with an explicit automatic-differentiation mode.
§Errors
Returns laddu_autodiff::AutodiffError when model lowering or
differentiation fails.
Sourcepub fn prepare_with_modes(
&self,
model: &CompiledModel,
autodiff_mode: AutodiffMode,
execution_mode: CpuExecutionMode,
) -> AutodiffResult<CpuPlan>
pub fn prepare_with_modes( &self, model: &CompiledModel, autodiff_mode: AutodiffMode, execution_mode: CpuExecutionMode, ) -> AutodiffResult<CpuPlan>
Prepares a model with explicit autodiff and scalar execution modes.
§Errors
Returns laddu_autodiff::AutodiffError when model lowering or
differentiation fails.
Trait Implementations§
Source§impl Clone for CpuBackend
impl Clone for CpuBackend
Source§fn clone(&self) -> CpuBackend
fn clone(&self) -> CpuBackend
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CpuBackend
impl Debug for CpuBackend
Source§impl Default for CpuBackend
impl Default for CpuBackend
Source§fn default() -> CpuBackend
fn default() -> CpuBackend
Auto Trait Implementations§
impl Freeze for CpuBackend
impl RefUnwindSafe for CpuBackend
impl Send for CpuBackend
impl Sync for CpuBackend
impl Unpin for CpuBackend
impl UnsafeUnpin for CpuBackend
impl UnwindSafe for CpuBackend
Blanket Implementations§
impl<T> Allocation 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
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.