pub struct MultiGpuExecutor { /* private fields */ }Expand description
Real multi-GPU executor backed by one crate::WgpuBackend per adapter.
Implementations§
Source§impl MultiGpuExecutor
impl MultiGpuExecutor
Sourcepub fn enumerate_live_gpus() -> Vec<LiveGpu>
pub fn enumerate_live_gpus() -> Vec<LiveGpu>
Enumerate real GPU adapters visible to wgpu.
Sourcepub fn acquire_all() -> Result<Self, BackendError>
pub fn acquire_all() -> Result<Self, BackendError>
Build an executor over every real adapter that can create a device.
§Errors
Returns a backend error when no real adapters are visible or when a visible adapter fails device creation.
Sourcepub fn acquire_indices(indices: &[usize]) -> Result<Self, BackendError>
pub fn acquire_indices(indices: &[usize]) -> Result<Self, BackendError>
Build an executor over explicit adapter indices.
§Errors
Returns a backend error if the list is empty, duplicated, or contains an adapter that cannot create a real GPU device.
Sourcepub fn adapter_indices(&self) -> Vec<usize>
pub fn adapter_indices(&self) -> Vec<usize>
Adapter indices owned by this executor.
Sourcepub fn dispatch_batch(
&mut self,
items: Vec<GpuWorkItem>,
) -> Result<Vec<GpuWorkOutput>, BackendError>
pub fn dispatch_batch( &mut self, items: Vec<GpuWorkItem>, ) -> Result<Vec<GpuWorkOutput>, BackendError>
Dispatch a batch across the selected adapters using the LPT partitioner.
Dispatches are submitted from one host thread per selected adapter. wgpu devices are independent, so separate physical adapters can compile, submit, and read back concurrently.
Sourcepub fn dispatch_borrowed_batch(
&mut self,
items: &[BorrowedGpuWorkItem<'_>],
) -> Result<Vec<Result<GpuWorkOutput, BackendError>>, BackendError>
pub fn dispatch_borrowed_batch( &mut self, items: &[BorrowedGpuWorkItem<'_>], ) -> Result<Vec<Result<GpuWorkOutput, BackendError>>, BackendError>
Dispatch a borrowed batch across selected adapters without cloning input buffers into owned work packets.
Each adapter receives one backend-local batched submission, so wgpu’s per-device command buffers stay valid while independent adapters run on separate host threads.