pub struct AotCache { /* private fields */ }Expand description
On-disk AOT cache for optimized LIR modules.
Implementations§
Source§impl AotCache
impl AotCache
pub fn new(root: impl Into<PathBuf>) -> Self
Sourcepub fn put_lir(&self, key: &str, lir: &LirModule) -> Result<LirFingerprint>
pub fn put_lir(&self, key: &str, lir: &LirModule) -> Result<LirFingerprint>
Persist an optimized LIR module. Returns its compile fingerprint.
pub fn contains(&self, key: &str) -> bool
Sourcepub fn compile_graph_cached(
&self,
key: &str,
device: Device,
graph: Graph,
options: &CompileOptions,
) -> Result<CompiledGraph, AotCacheError>
pub fn compile_graph_cached( &self, key: &str, device: Device, graph: Graph, options: &CompileOptions, ) -> Result<CompiledGraph, AotCacheError>
MIR graph → fusion pipeline → cached LIR → backend executable.
On a cache hit only the backend compile runs (fusion / vmap /
autodiff already done). Keys must be unique per graph + options
fingerprint the caller encodes in key.
Sourcepub fn compile_hir_cached(
&self,
key: &str,
device: Device,
hir: HirModule,
options: &CompileOptions,
) -> Result<CompiledGraph, AotCacheError>
pub fn compile_hir_cached( &self, key: &str, device: Device, hir: HirModule, options: &CompileOptions, ) -> Result<CompiledGraph, AotCacheError>
Compile HIR through the fusion pipeline, cache LIR, return executable.
Sourcepub fn specialize_cached(
&self,
base_key: &str,
binding: &DimBinding,
device: Device,
template: &CompileResult,
options: &CompileOptions,
) -> Result<CompiledGraph, AotCacheError>
pub fn specialize_cached( &self, base_key: &str, binding: &DimBinding, device: Device, template: &CompileResult, options: &CompileOptions, ) -> Result<CompiledGraph, AotCacheError>
Specialize a cached dynamic LIR template and persist the bound variant.
Auto Trait Implementations§
impl Freeze for AotCache
impl RefUnwindSafe for AotCache
impl Send for AotCache
impl Sync for AotCache
impl Unpin for AotCache
impl UnsafeUnpin for AotCache
impl UnwindSafe for AotCache
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
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>
Converts
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>
Converts
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