pub struct GPUMemoryManager { /* private fields */ }
Expand description
GPU Memory manager for sparse FFT operations
Implementations§
Source§impl GPUMemoryManager
impl GPUMemoryManager
Sourcepub fn new(
backend: GPUBackend,
device_id: i32,
allocation_strategy: AllocationStrategy,
max_memory: usize,
) -> Self
pub fn new( backend: GPUBackend, device_id: i32, allocation_strategy: AllocationStrategy, max_memory: usize, ) -> Self
Create a new GPU memory manager
Sourcepub fn backend_name(&self) -> &'static str
pub fn backend_name(&self) -> &'static str
Get backend name
Sourcepub fn allocate_buffer(
&mut self,
size: usize,
element_size: usize,
location: BufferLocation,
buffer_type: BufferType,
) -> FFTResult<BufferDescriptor>
pub fn allocate_buffer( &mut self, size: usize, element_size: usize, location: BufferLocation, buffer_type: BufferType, ) -> FFTResult<BufferDescriptor>
Allocate a buffer of specified size and type
Sourcepub fn release_buffer(&mut self, descriptor: BufferDescriptor) -> FFTResult<()>
pub fn release_buffer(&mut self, descriptor: BufferDescriptor) -> FFTResult<()>
Release a buffer
Sourcepub fn clear_cache(&mut self) -> FFTResult<()>
pub fn clear_cache(&mut self) -> FFTResult<()>
Clear the buffer cache
Sourcepub fn current_memory_usage(&self) -> usize
pub fn current_memory_usage(&self) -> usize
Get current memory usage
Sourcepub fn memory_limit(&self) -> usize
pub fn memory_limit(&self) -> usize
Get memory limit
Auto Trait Implementations§
impl Freeze for GPUMemoryManager
impl RefUnwindSafe for GPUMemoryManager
impl Send for GPUMemoryManager
impl Sync for GPUMemoryManager
impl Unpin for GPUMemoryManager
impl UnwindSafe for GPUMemoryManager
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
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