pub struct KernelCache { /* private fields */ }Expand description
A cache that stores multiple KernelSpec entries and provides lookup.
Implementations§
Source§impl KernelCache
impl KernelCache
Sourcepub fn add(&mut self, spec: KernelSpec)
pub fn add(&mut self, spec: KernelSpec)
Adds a kernel spec to the cache.
Sourcepub fn find(&self, kt: &KernelType) -> Option<&KernelSpec>
pub fn find(&self, kt: &KernelType) -> Option<&KernelSpec>
Finds the first spec whose kernel_type matches kt.
Sourcepub fn total_memory_estimate_bytes(&self) -> u64
pub fn total_memory_estimate_bytes(&self) -> u64
Estimates total GPU memory required for all cached specs (bytes).
Each element occupies 4 bytes (f32), multiplied by channel count.
Sourcepub fn kernel_count(&self) -> usize
pub fn kernel_count(&self) -> usize
Returns the number of specs in the cache.
Trait Implementations§
Source§impl Debug for KernelCache
impl Debug for KernelCache
Source§impl Default for KernelCache
impl Default for KernelCache
Source§fn default() -> KernelCache
fn default() -> KernelCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for KernelCache
impl RefUnwindSafe for KernelCache
impl Send for KernelCache
impl Sync for KernelCache
impl Unpin for KernelCache
impl UnsafeUnpin for KernelCache
impl UnwindSafe for KernelCache
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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