pub struct AdvancedMemoryPool<T: TensorElement> { /* private fields */ }Expand description
Memory pool for efficient tensor allocation
Implementations§
Source§impl<T: TensorElement> AdvancedMemoryPool<T>
impl<T: TensorElement> AdvancedMemoryPool<T>
Sourcepub fn with_config(config: MemoryConfig) -> Self
pub fn with_config(config: MemoryConfig) -> Self
Create with custom configuration
Sourcepub fn deallocate(&self, ptr: NonNull<T>, size: usize) -> Result<()>
pub fn deallocate(&self, ptr: NonNull<T>, size: usize) -> Result<()>
Deallocate memory back to pool
Sourcepub fn get_stats(&self) -> MemoryStats
pub fn get_stats(&self) -> MemoryStats
Get memory pool statistics
Sourcepub fn defragment(&self) -> Result<DefragmentationReport>
pub fn defragment(&self) -> Result<DefragmentationReport>
Trigger garbage collection and defragmentation
Trait Implementations§
Source§impl<T: TensorElement> Default for AdvancedMemoryPool<T>
impl<T: TensorElement> Default for AdvancedMemoryPool<T>
Auto Trait Implementations§
impl<T> !Freeze for AdvancedMemoryPool<T>
impl<T> RefUnwindSafe for AdvancedMemoryPool<T>
impl<T> !Send for AdvancedMemoryPool<T>
impl<T> !Sync for AdvancedMemoryPool<T>
impl<T> Unpin for AdvancedMemoryPool<T>
impl<T> UnsafeUnpin for AdvancedMemoryPool<T>
impl<T> UnwindSafe for AdvancedMemoryPool<T>
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