pub struct MultiGpuManager { /* private fields */ }Expand description
Multi-GPU manager for coordinating multiple devices.
Implementations§
Source§impl MultiGpuManager
impl MultiGpuManager
Sourcepub async fn new(config: MultiGpuConfig) -> GpuResult<Self>
pub async fn new(config: MultiGpuConfig) -> GpuResult<Self>
Create a new multi-GPU manager.
§Errors
Returns an error if minimum number of devices cannot be found.
Sourcepub fn num_devices(&self) -> usize
pub fn num_devices(&self) -> usize
Get the number of available devices.
Sourcepub fn devices(&self) -> &[Arc<GpuContext>]
pub fn devices(&self) -> &[Arc<GpuContext>]
Get all device contexts.
Sourcepub fn device_info(&self, index: usize) -> Option<&GpuDeviceInfo>
pub fn device_info(&self, index: usize) -> Option<&GpuDeviceInfo>
Get device information.
Sourcepub fn all_device_info(&self) -> &[GpuDeviceInfo]
pub fn all_device_info(&self) -> &[GpuDeviceInfo]
Get all device information.
Sourcepub fn select_device(&self) -> usize
pub fn select_device(&self) -> usize
Select a device based on load balancing strategy.
Sourcepub fn dispatch<F, T>(&self, workload: f64, f: F) -> GpuResult<T>
pub fn dispatch<F, T>(&self, workload: f64, f: F) -> GpuResult<T>
Dispatch work to a device with load balancing.
Auto Trait Implementations§
impl Freeze for MultiGpuManager
impl !RefUnwindSafe for MultiGpuManager
impl Send for MultiGpuManager
impl Sync for MultiGpuManager
impl Unpin for MultiGpuManager
impl UnsafeUnpin for MultiGpuManager
impl !UnwindSafe for MultiGpuManager
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