Skip to main content

MemoryManager

Struct MemoryManager 

Source
pub struct MemoryManager { /* private fields */ }
Expand description

Central memory manager that coordinates all memory subsystems

Implementations§

Source§

impl MemoryManager

Source

pub fn new() -> Self

Create a new memory manager

Source

pub fn with_pool_size(pool_size: usize) -> Self

Create a new memory manager with custom pool size

Source

pub fn check_memory_alias( &self, buffer_id: usize, offset: usize, size: usize, ) -> bool

Check for memory aliasing between tensor views

Source

pub fn register_memory_view(&self, buffer_id: usize, offset: usize, size: usize)

Register a new memory view for alias detection

Source

pub fn unregister_memory_view( &self, buffer_id: usize, offset: usize, size: usize, )

Unregister a memory view

Source

pub fn get_optimal_access_pattern( &self, dims: &[usize], element_size: usize, ) -> AccessPattern

Get optimal memory access pattern for given dimensions

Source

pub fn get_optimal_alignment(&self, data_size: usize) -> usize

Get optimal alignment for data of given size

Source

pub fn record_memory_operation(&self, operation: &str, size: usize)

Record a memory operation for performance tracking

Source

pub fn get_memory_statistics(&self) -> MemoryStatistics

Get comprehensive memory statistics across all devices

Source

pub fn generate_report(&self) -> String

Generate comprehensive memory management report

Source

pub fn optimize_tensor_layout( &self, shape: &[usize], element_size: usize, ) -> TensorLayoutOptimization

Optimize memory layout for tensor operations

Source

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

Source

pub fn set_default_pool_size(&mut self, size: usize)

Set the default pool size for new memory pools

Source

pub fn default_pool_size(&self) -> usize

Get the current default pool size

Source

pub fn clear(&self)

Clear all memory pools and reset the manager

Source

pub fn cache_optimizer(&self) -> &CacheOptimizer

Get cache optimizer reference

Source

pub fn performance_monitor(&self) -> &PerformanceMonitor

Get performance monitor reference

Source

pub fn alias_detector(&self) -> &MemoryAliasDetector

Get alias detector reference

Trait Implementations§

Source§

impl Default for MemoryManager

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V