pub struct DeviceSlot {
pub device: Arc<GpuDevice>,
pub weight: f32,
pub stats: Mutex<DeviceStats>,
pub index: usize,
}Expand description
A device slot held by the multi-GPU scheduler.
Fields§
§device: Arc<GpuDevice>The GPU device.
weight: f32Static capacity weight (used by LoadBalanceStrategy::WeightedCapacity).
stats: Mutex<DeviceStats>Device-level statistics (protected by a mutex for multi-threaded access).
index: usizeUnique index assigned by the scheduler.
Implementations§
Source§impl DeviceSlot
impl DeviceSlot
Sourcepub fn new(device: Arc<GpuDevice>, index: usize, weight: f32) -> Self
pub fn new(device: Arc<GpuDevice>, index: usize, weight: f32) -> Self
Create a new device slot.
Sourcepub fn on_dispatch(&self)
pub fn on_dispatch(&self)
Record a dispatched frame.
Sourcepub fn on_complete(&self, latency_secs: f64)
pub fn on_complete(&self, latency_secs: f64)
Record a completed frame with the measured latency in seconds.
Sourcepub fn on_failure(&self)
pub fn on_failure(&self)
Record a failed frame.
Sourcepub fn queue_depth(&self) -> u64
pub fn queue_depth(&self) -> u64
Current queue depth (lock-free snapshot).
Sourcepub fn ema_throughput(&self) -> f64
pub fn ema_throughput(&self) -> f64
Current EMA throughput (lock-free snapshot).
Auto Trait Implementations§
impl !Freeze for DeviceSlot
impl !RefUnwindSafe for DeviceSlot
impl !UnwindSafe for DeviceSlot
impl Send for DeviceSlot
impl Sync for DeviceSlot
impl Unpin for DeviceSlot
impl UnsafeUnpin for DeviceSlot
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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