pub struct GpuProbes { /* private fields */ }Expand description
In-memory counters for the GPU-specific probes. The probes are
passive: kernel actors / stream allocators bump the counters
directly; the dashboard polls via GpuProbes::snapshot.
Construct one per host (or per device if you want per-device
breakdowns), share via Arc, and pass to whichever code paths
produce the events.
Implementations§
Source§impl GpuProbes
impl GpuProbes
pub fn new() -> Arc<Self>
Sourcepub fn record_alloc_ok(&self)
pub fn record_alloc_ok(&self)
Record a successful allocation.
Sourcepub fn record_alloc_oom(&self)
pub fn record_alloc_oom(&self)
Record an allocation that hit OOM.
Sourcepub fn record_generation(&self, gen: u64)
pub fn record_generation(&self, gen: u64)
Record observation of a new DeviceState::generation. The
stored value is monotonically max’d.
Sourcepub fn kernel_enter(&self)
pub fn kernel_enter(&self)
Bump the in-flight kernel count when a kernel is enqueued.
Sourcepub fn kernel_exit(&self)
pub fn kernel_exit(&self)
Decrement the in-flight kernel count when a kernel completes.
Sourcepub fn record_vram(&self, free_bytes: u64, total_bytes: u64)
pub fn record_vram(&self, free_bytes: u64, total_bytes: u64)
Record the latest VRAM snapshot (typically from
cuMemGetInfo once per PlacementActor::PollStats tick).
Sourcepub fn snapshot(&self) -> GpuProbeState
pub fn snapshot(&self) -> GpuProbeState
Snapshot the current counter state.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for GpuProbes
impl !RefUnwindSafe for GpuProbes
impl Send for GpuProbes
impl Sync for GpuProbes
impl Unpin for GpuProbes
impl UnsafeUnpin for GpuProbes
impl UnwindSafe for GpuProbes
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