pub struct AdvancedAdaptiveMemoryManager<F> { /* private fields */ }Expand description
Advanced-advanced adaptive memory manager
Implementations§
Source§impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
Sourcepub fn get_performance_metrics(&self) -> MemoryPerformanceMetrics
pub fn get_performance_metrics(&self) -> MemoryPerformanceMetrics
Get performance metrics
Sourcepub fn get_config(&self) -> &AdaptiveMemoryConfig
pub fn get_config(&self) -> &AdaptiveMemoryConfig
Get the current memory configuration
Source§impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
Sourcepub fn get_memory_stats(&self) -> MemoryUsageStatistics
pub fn get_memory_stats(&self) -> MemoryUsageStatistics
Get memory usage statistics
Sourcepub fn calculate_total_allocated(&self) -> usize
pub fn calculate_total_allocated(&self) -> usize
Calculate total allocated memory
Sourcepub fn calculate_peak_allocated(&self) -> usize
pub fn calculate_peak_allocated(&self) -> usize
Calculate peak allocated memory
Sourcepub fn calculate_fragmentation(&self) -> f64
pub fn calculate_fragmentation(&self) -> f64
Calculate memory fragmentation ratio
Source§impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
Sourcepub fn allocate(&self, size: usize) -> StatsResult<*mut u8>
pub fn allocate(&self, size: usize) -> StatsResult<*mut u8>
Allocate memory with optimal strategy
Sourcepub fn allocate_system(&self, size: usize) -> StatsResult<*mut u8>
pub fn allocate_system(&self, size: usize) -> StatsResult<*mut u8>
System allocator
Sourcepub fn allocate_pool(&self, size: usize) -> StatsResult<*mut u8>
pub fn allocate_pool(&self, size: usize) -> StatsResult<*mut u8>
Pool allocator
Sourcepub fn allocate_numa_aware(
&self,
size: usize,
context: &AllocationContext,
) -> StatsResult<*mut u8>
pub fn allocate_numa_aware( &self, size: usize, context: &AllocationContext, ) -> StatsResult<*mut u8>
NUMA-aware allocator
Sourcepub fn allocate_memory_mapped(&self, size: usize) -> StatsResult<*mut u8>
pub fn allocate_memory_mapped(&self, size: usize) -> StatsResult<*mut u8>
Memory-mapped allocator
Sourcepub fn allocate_adaptive(
&self,
size: usize,
context: &AllocationContext,
) -> StatsResult<*mut u8>
pub fn allocate_adaptive( &self, size: usize, context: &AllocationContext, ) -> StatsResult<*mut u8>
Adaptive allocator
Sourcepub fn allocate_zero_copy(&self, size: usize) -> StatsResult<*mut u8>
pub fn allocate_zero_copy(&self, size: usize) -> StatsResult<*mut u8>
Zero-copy allocator
Source§impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
Sourcepub fn calculate_poolsize(&self, size: usize) -> usize
pub fn calculate_poolsize(&self, size: usize) -> usize
Calculate appropriate pool size for allocation
Sourcepub fn deallocate_pool(&self, ptr: *mut u8, size: usize) -> StatsResult<()>
pub fn deallocate_pool(&self, ptr: *mut u8, size: usize) -> StatsResult<()>
Pool deallocation
Source§impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
Sourcepub fn calculate_total_requested(&self) -> usize
pub fn calculate_total_requested(&self) -> usize
Calculate total requested memory
Source§impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
Sourcepub fn calculate_urgency(&self, size: usize, pressure: f64) -> AllocationUrgency
pub fn calculate_urgency(&self, size: usize, pressure: f64) -> AllocationUrgency
Calculate allocation urgency
Source§impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
Sourcepub fn deallocate(&self, ptr: *mut u8, size: usize) -> StatsResult<()>
pub fn deallocate(&self, ptr: *mut u8, size: usize) -> StatsResult<()>
Deallocate memory
Sourcepub fn infer_deallocation_strategy(
&self,
ptr: *mut u8,
size: usize,
) -> AllocationStrategy
pub fn infer_deallocation_strategy( &self, ptr: *mut u8, size: usize, ) -> AllocationStrategy
Infer deallocation strategy from pointer
Sourcepub fn deallocate_system(&self, ptr: *mut u8, size: usize) -> StatsResult<()>
pub fn deallocate_system(&self, ptr: *mut u8, size: usize) -> StatsResult<()>
System deallocation
Sourcepub fn deallocate_numa_aware(
&self,
ptr: *mut u8,
size: usize,
) -> StatsResult<()>
pub fn deallocate_numa_aware( &self, ptr: *mut u8, size: usize, ) -> StatsResult<()>
NUMA-aware deallocation
Sourcepub fn deallocate_memory_mapped(
&self,
ptr: *mut u8,
size: usize,
) -> StatsResult<()>
pub fn deallocate_memory_mapped( &self, ptr: *mut u8, size: usize, ) -> StatsResult<()>
Memory-mapped deallocation
Sourcepub fn deallocate_adaptive(&self, ptr: *mut u8, size: usize) -> StatsResult<()>
pub fn deallocate_adaptive(&self, ptr: *mut u8, size: usize) -> StatsResult<()>
Adaptive deallocation
Sourcepub fn deallocate_zero_copy(&self, ptr: *mut u8, size: usize) -> StatsResult<()>
pub fn deallocate_zero_copy(&self, ptr: *mut u8, size: usize) -> StatsResult<()>
Zero-copy deallocation
Source§impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
Sourcepub fn extract_allocation_features(
&self,
context: &AllocationContext,
) -> Vec<f64>
pub fn extract_allocation_features( &self, context: &AllocationContext, ) -> Vec<f64>
Extract features for allocation strategy prediction
Source§impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
Sourcepub fn infer_allocation_type(&self, size: usize) -> AllocationType
pub fn infer_allocation_type(&self, size: usize) -> AllocationType
Infer allocation type from size and context
Source§impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
Sourcepub fn with_config(config: AdaptiveMemoryConfig) -> Self
pub fn with_config(config: AdaptiveMemoryConfig) -> Self
Create with custom configuration
Sourcepub fn get_or_create_pool(
&self,
poolsize: usize,
) -> StatsResult<Arc<MemoryPool>>
pub fn get_or_create_pool( &self, poolsize: usize, ) -> StatsResult<Arc<MemoryPool>>
Get or create memory pool
Source§impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
Sourcepub fn optimize_layout<T>(
&self,
data: &mut ArrayView2<'_, T>,
) -> StatsResult<()>
pub fn optimize_layout<T>( &self, data: &mut ArrayView2<'_, T>, ) -> StatsResult<()>
Optimize memory layout for better cache performance
Source§impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
Sourcepub fn trigger_gc(&self) -> StatsResult<GCResult>
pub fn trigger_gc(&self) -> StatsResult<GCResult>
Trigger garbage collection
Source§impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
impl<F> AdaptiveMemoryManager<F>where
F: Float + NumCast + SimdUnifiedOps + Zero + One + PartialOrd + Copy + Send + Sync + 'static + Display,
Sourcepub fn update_config(&mut self, config: AdaptiveMemoryConfig)
pub fn update_config(&mut self, config: AdaptiveMemoryConfig)
Update configuration
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for AdaptiveMemoryManager<F>
impl<F> !RefUnwindSafe for AdaptiveMemoryManager<F>
impl<F> !Send for AdaptiveMemoryManager<F>
impl<F> !Sync for AdaptiveMemoryManager<F>
impl<F> Unpin for AdaptiveMemoryManager<F>where
F: Unpin,
impl<F> UnsafeUnpin for AdaptiveMemoryManager<F>
impl<F> !UnwindSafe for AdaptiveMemoryManager<F>
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
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> ⓘ
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> ⓘ
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.