pub struct MultiGpuMemoryManager { /* private fields */ }Expand description
Multi-GPU memory manager
Implementations§
Source§impl MultiGpuMemoryManager
impl MultiGpuMemoryManager
pub fn new() -> Self
Sourcepub fn add_device(&mut self, device: GpuDevice)
pub fn add_device(&mut self, device: GpuDevice)
Add a device to the manager
Sourcepub fn allocate_on_device(
&self,
device_id: u32,
size: usize,
) -> Result<GpuMemoryBlock, SimdError>
pub fn allocate_on_device( &self, device_id: u32, size: usize, ) -> Result<GpuMemoryBlock, SimdError>
Allocate memory on the specified device
Sourcepub fn allocate_on_best_device(
&self,
size: usize,
) -> Result<(u32, GpuMemoryBlock), SimdError>
pub fn allocate_on_best_device( &self, size: usize, ) -> Result<(u32, GpuMemoryBlock), SimdError>
Allocate memory on the best available device
Sourcepub fn deallocate_on_device(
&self,
device_id: u32,
ptr: *mut u8,
) -> Result<(), SimdError>
pub fn deallocate_on_device( &self, device_id: u32, ptr: *mut u8, ) -> Result<(), SimdError>
Deallocate memory on the specified device
Sourcepub fn get_all_stats(&self) -> HashMap<u32, MemoryStats>
pub fn get_all_stats(&self) -> HashMap<u32, MemoryStats>
Get memory statistics for all devices
Sourcepub fn set_allocation_strategy(&mut self, strategy: AllocationStrategy)
pub fn set_allocation_strategy(&mut self, strategy: AllocationStrategy)
Configure allocation strategy
Sourcepub fn set_bandwidth_config(&mut self, config: BandwidthConfig)
pub fn set_bandwidth_config(&mut self, config: BandwidthConfig)
Configure bandwidth optimization
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MultiGpuMemoryManager
impl RefUnwindSafe for MultiGpuMemoryManager
impl Send for MultiGpuMemoryManager
impl Sync for MultiGpuMemoryManager
impl Unpin for MultiGpuMemoryManager
impl UnsafeUnpin for MultiGpuMemoryManager
impl UnwindSafe for MultiGpuMemoryManager
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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