Skip to main content

AdvancedMemoryManager

Trait AdvancedMemoryManager 

Source
pub trait AdvancedMemoryManager: DeviceMemoryManager {
    // Required methods
    fn map_memory<'life0, 'async_trait>(
        &'life0 self,
        handle: MemoryHandle,
        access: MemoryAccess,
    ) -> Pin<Box<dyn Future<Output = Result<*mut u8>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn unmap_memory<'life0, 'async_trait>(
        &'life0 self,
        handle: MemoryHandle,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn create_mapping<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        src_device: &'life1 Device,
        dst_device: &'life2 Device,
        size: usize,
    ) -> Pin<Box<dyn Future<Output = Result<(MemoryHandle, MemoryHandle)>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn prefetch<'life0, 'life1, 'async_trait>(
        &'life0 self,
        handle: MemoryHandle,
        target_device: &'life1 Device,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn access_stats(&self, handle: MemoryHandle) -> Option<MemoryAccessStats>;
    fn set_usage_hint<'life0, 'async_trait>(
        &'life0 self,
        handle: MemoryHandle,
        hint: MemoryUsageHint,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Advanced memory operations

Required Methods§

Source

fn map_memory<'life0, 'async_trait>( &'life0 self, handle: MemoryHandle, access: MemoryAccess, ) -> Pin<Box<dyn Future<Output = Result<*mut u8>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Map memory for direct CPU access

Source

fn unmap_memory<'life0, 'async_trait>( &'life0 self, handle: MemoryHandle, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Unmap previously mapped memory

Source

fn create_mapping<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, src_device: &'life1 Device, dst_device: &'life2 Device, size: usize, ) -> Pin<Box<dyn Future<Output = Result<(MemoryHandle, MemoryHandle)>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Create memory mapping between devices

Source

fn prefetch<'life0, 'life1, 'async_trait>( &'life0 self, handle: MemoryHandle, target_device: &'life1 Device, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Enable memory prefetching

Source

fn access_stats(&self, handle: MemoryHandle) -> Option<MemoryAccessStats>

Get memory access pattern statistics

Source

fn set_usage_hint<'life0, 'async_trait>( &'life0 self, handle: MemoryHandle, hint: MemoryUsageHint, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Set memory usage hints

Implementors§