DeviceMemory

Trait DeviceMemory 

Source
pub trait DeviceMemory: Send + Sync {
    // Required methods
    fn allocate(&self, size: usize) -> Result<Box<dyn GpuBuffer>>;
    fn allocate_aligned(
        &self,
        size: usize,
        alignment: usize,
    ) -> Result<Box<dyn GpuBuffer>>;
    fn total_memory(&self) -> usize;
    fn free_memory(&self) -> usize;
}
Expand description

Trait for device memory allocation.

Required Methods§

Source

fn allocate(&self, size: usize) -> Result<Box<dyn GpuBuffer>>

Allocate device memory.

Source

fn allocate_aligned( &self, size: usize, alignment: usize, ) -> Result<Box<dyn GpuBuffer>>

Allocate device memory with alignment.

Source

fn total_memory(&self) -> usize

Get total device memory.

Source

fn free_memory(&self) -> usize

Get free device memory.

Implementors§