pub struct DynamicDimCompileCache { /* private fields */ }Expand description
Compile-once / specialize-at-runtime cache for symbolic HIR modules.
Implementations§
Source§impl DynamicDimCompileCache
impl DynamicDimCompileCache
pub fn new(device: Device, capacity: usize) -> Self
pub fn with_policy( device: Device, capacity: usize, policy: Option<PrecisionPolicy>, ) -> Self
pub fn compile_device(&self) -> Device
Sourcepub fn get_or_specialize<F: FnOnce() -> HirModule>(
&mut self,
key: u64,
binding: &DimBinding,
build_hir: F,
options: &CompileOptions,
) -> Result<&mut CompiledGraph, LowerError>
pub fn get_or_specialize<F: FnOnce() -> HirModule>( &mut self, key: u64, binding: &DimBinding, build_hir: F, options: &CompileOptions, ) -> Result<&mut CompiledGraph, LowerError>
Return a backend-compiled graph specialized for binding.
build_hir runs at most once to populate the dynamic template.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn contains(&self, key: u64) -> bool
pub fn has_template(&self) -> bool
Sourcepub fn ensure_template<F: FnOnce() -> HirModule>(
&mut self,
build_hir: F,
options: &CompileOptions,
) -> Result<&CompileResult, LowerError>
pub fn ensure_template<F: FnOnce() -> HirModule>( &mut self, build_hir: F, options: &CompileOptions, ) -> Result<&CompileResult, LowerError>
Build the symbolic template once (no specialization).
pub fn template_result(&self) -> Option<&CompileResult>
Sourcepub fn get_or_specialize_aot<F: FnOnce() -> HirModule>(
&mut self,
aot: &AotCache,
disk_base: &str,
key: u64,
binding: &DimBinding,
build_hir: F,
options: &CompileOptions,
) -> Result<&mut CompiledGraph, AotCacheError>
pub fn get_or_specialize_aot<F: FnOnce() -> HirModule>( &mut self, aot: &AotCache, disk_base: &str, key: u64, binding: &DimBinding, build_hir: F, options: &CompileOptions, ) -> Result<&mut CompiledGraph, AotCacheError>
Specialize via on-disk LIR cache ([CompilationMode::Aot]).
Disk-backed specialize (rlx_ir::CompilationMode::Aot).
Auto Trait Implementations§
impl Freeze for DynamicDimCompileCache
impl !RefUnwindSafe for DynamicDimCompileCache
impl Send for DynamicDimCompileCache
impl !Sync for DynamicDimCompileCache
impl Unpin for DynamicDimCompileCache
impl UnsafeUnpin for DynamicDimCompileCache
impl !UnwindSafe for DynamicDimCompileCache
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