pub struct MultiGpuMemoryManager { /* private fields */ }Expand description
Memory manager for multiple GPU devices
Implementations§
Source§impl MultiGpuMemoryManager
impl MultiGpuMemoryManager
Sourcepub fn new(
pool: Arc<GpuDevicePool>,
budget_per_device: MemoryBudget,
) -> Result<Self>
pub fn new( pool: Arc<GpuDevicePool>, budget_per_device: MemoryBudget, ) -> Result<Self>
Create a new multi-GPU memory manager
Sourcepub fn device_count(&self) -> usize
pub fn device_count(&self) -> usize
Get the number of devices
Sourcepub fn alloc_on_device<T: DeviceRepr>(
&self,
device_idx: usize,
len: usize,
) -> Result<TrackedCudaSlice<T>>
pub fn alloc_on_device<T: DeviceRepr>( &self, device_idx: usize, len: usize, ) -> Result<TrackedCudaSlice<T>>
Allocate memory on a specific device
Sourcepub fn alloc_next<T: DeviceRepr>(
&self,
len: usize,
) -> Result<(usize, TrackedCudaSlice<T>)>
pub fn alloc_next<T: DeviceRepr>( &self, len: usize, ) -> Result<(usize, TrackedCudaSlice<T>)>
Allocate memory on the next device (round-robin)
Sourcepub fn get_manager(&self, device_idx: usize) -> Option<&Arc<GpuMemoryManager>>
pub fn get_manager(&self, device_idx: usize) -> Option<&Arc<GpuMemoryManager>>
Get the memory manager for a specific device
Sourcepub fn remaining_bytes(&self, device_idx: usize) -> u64
pub fn remaining_bytes(&self, device_idx: usize) -> u64
Get remaining bytes on a specific device
Sourcepub fn pool(&self) -> &Arc<GpuDevicePool>
pub fn pool(&self) -> &Arc<GpuDevicePool>
Get the device pool
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