pub struct GpuTensorCache { /* private fields */ }Expand description
Advanced GPU tensor caching with memory-aware eviction
Implementations§
Source§impl GpuTensorCache
impl GpuTensorCache
Sourcepub fn new(max_cache_size: usize, max_memory_limit: usize) -> Self
pub fn new(max_cache_size: usize, max_memory_limit: usize) -> Self
Create a new GPU tensor cache
Sourcepub fn cache_tensor(
&mut self,
key: String,
tensor: Tensor,
importance_score: Option<f32>,
) -> Result<()>
pub fn cache_tensor( &mut self, key: String, tensor: Tensor, importance_score: Option<f32>, ) -> Result<()>
Cache a tensor with optional importance score
Sourcepub fn get_tensor(&mut self, key: &str) -> Option<&Tensor>
pub fn get_tensor(&mut self, key: &str) -> Option<&Tensor>
Retrieve a tensor from cache
Sourcepub fn get_comprehensive_stats(&self) -> GpuCacheStatistics
pub fn get_comprehensive_stats(&self) -> GpuCacheStatistics
Get comprehensive cache statistics
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GpuTensorCache
impl RefUnwindSafe for GpuTensorCache
impl Send for GpuTensorCache
impl Sync for GpuTensorCache
impl Unpin for GpuTensorCache
impl UnsafeUnpin for GpuTensorCache
impl UnwindSafe for GpuTensorCache
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