pub struct MemoryManager { /* private fields */ }Expand description
Central memory manager that coordinates all memory subsystems
Implementations§
Source§impl MemoryManager
impl MemoryManager
Sourcepub fn with_pool_size(pool_size: usize) -> Self
pub fn with_pool_size(pool_size: usize) -> Self
Create a new memory manager with custom pool size
Sourcepub fn check_memory_alias(
&self,
buffer_id: usize,
offset: usize,
size: usize,
) -> bool
pub fn check_memory_alias( &self, buffer_id: usize, offset: usize, size: usize, ) -> bool
Check for memory aliasing between tensor views
Sourcepub fn register_memory_view(&self, buffer_id: usize, offset: usize, size: usize)
pub fn register_memory_view(&self, buffer_id: usize, offset: usize, size: usize)
Register a new memory view for alias detection
Sourcepub fn unregister_memory_view(
&self,
buffer_id: usize,
offset: usize,
size: usize,
)
pub fn unregister_memory_view( &self, buffer_id: usize, offset: usize, size: usize, )
Unregister a memory view
Sourcepub fn get_optimal_access_pattern(
&self,
dims: &[usize],
element_size: usize,
) -> AccessPattern
pub fn get_optimal_access_pattern( &self, dims: &[usize], element_size: usize, ) -> AccessPattern
Get optimal memory access pattern for given dimensions
Sourcepub fn get_optimal_alignment(&self, data_size: usize) -> usize
pub fn get_optimal_alignment(&self, data_size: usize) -> usize
Get optimal alignment for data of given size
Sourcepub fn record_memory_operation(&self, operation: &str, size: usize)
pub fn record_memory_operation(&self, operation: &str, size: usize)
Record a memory operation for performance tracking
Sourcepub fn get_memory_statistics(&self) -> MemoryStatistics
pub fn get_memory_statistics(&self) -> MemoryStatistics
Get comprehensive memory statistics across all devices
Sourcepub fn generate_report(&self) -> String
pub fn generate_report(&self) -> String
Generate comprehensive memory management report
Sourcepub fn optimize_tensor_layout(
&self,
shape: &[usize],
element_size: usize,
) -> TensorLayoutOptimization
pub fn optimize_tensor_layout( &self, shape: &[usize], element_size: usize, ) -> TensorLayoutOptimization
Optimize memory layout for tensor operations
Sourcepub fn create_strided_view(
&self,
offset: usize,
shape: Vec<usize>,
strides: Vec<usize>,
element_size: usize,
) -> StridedView
pub fn create_strided_view( &self, offset: usize, shape: Vec<usize>, strides: Vec<usize>, element_size: usize, ) -> StridedView
Create an optimized strided view for zero-copy operations
Sourcepub fn set_default_pool_size(&mut self, size: usize)
pub fn set_default_pool_size(&mut self, size: usize)
Set the default pool size for new memory pools
Sourcepub fn default_pool_size(&self) -> usize
pub fn default_pool_size(&self) -> usize
Get the current default pool size
Sourcepub fn cache_optimizer(&self) -> &CacheOptimizer
pub fn cache_optimizer(&self) -> &CacheOptimizer
Get cache optimizer reference
Sourcepub fn performance_monitor(&self) -> &PerformanceMonitor
pub fn performance_monitor(&self) -> &PerformanceMonitor
Get performance monitor reference
Sourcepub fn alias_detector(&self) -> &MemoryAliasDetector
pub fn alias_detector(&self) -> &MemoryAliasDetector
Get alias detector reference
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MemoryManager
impl RefUnwindSafe for MemoryManager
impl Send for MemoryManager
impl Sync for MemoryManager
impl Unpin for MemoryManager
impl UnsafeUnpin for MemoryManager
impl UnwindSafe for MemoryManager
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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