pub struct NumaAllocTracker { /* private fields */ }Expand description
Per-node accounting of NUMA-bound host allocations.
Tracks how many bytes are currently outstanding on each node so that a scheduler can balance pinned-memory pressure across sockets.
Implementations§
Source§impl NumaAllocTracker
impl NumaAllocTracker
Sourcepub fn new(topology: &NumaTopology) -> Self
pub fn new(topology: &NumaTopology) -> Self
Creates a tracker sized for topology’s node count.
Sourcepub fn record(&mut self, buf: &NumaBuffer) -> CudaResult<()>
pub fn record(&mut self, buf: &NumaBuffer) -> CudaResult<()>
Records that buf was allocated, adding its bytes to its node’s total.
§Errors
CudaError::InvalidValueif the buffer’s node is out of range for this tracker.
Sourcepub fn release(&mut self, buf: &NumaBuffer) -> CudaResult<()>
pub fn release(&mut self, buf: &NumaBuffer) -> CudaResult<()>
Records that buf was freed, subtracting its bytes from its node total.
§Errors
CudaError::InvalidValueif the buffer’s node is out of range.
Sourcepub fn bytes_on_node(&self, node: usize) -> Option<usize>
pub fn bytes_on_node(&self, node: usize) -> Option<usize>
Returns the bytes currently outstanding on node, or None if out of
range.
Sourcepub fn total_bytes(&self) -> usize
pub fn total_bytes(&self) -> usize
Returns the total bytes outstanding across all nodes.
Sourcepub fn least_loaded_node(&self) -> Option<usize>
pub fn least_loaded_node(&self) -> Option<usize>
Returns the index of the least-loaded node (fewest outstanding bytes).
Ties are broken by the lowest index. Returns None only if the
tracker has zero nodes (which cannot happen via new).
Trait Implementations§
Source§impl Clone for NumaAllocTracker
impl Clone for NumaAllocTracker
Source§fn clone(&self) -> NumaAllocTracker
fn clone(&self) -> NumaAllocTracker
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NumaAllocTracker
impl Debug for NumaAllocTracker
impl Eq for NumaAllocTracker
Source§impl PartialEq for NumaAllocTracker
impl PartialEq for NumaAllocTracker
Source§fn eq(&self, other: &NumaAllocTracker) -> bool
fn eq(&self, other: &NumaAllocTracker) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for NumaAllocTracker
Auto Trait Implementations§
impl Freeze for NumaAllocTracker
impl RefUnwindSafe for NumaAllocTracker
impl Send for NumaAllocTracker
impl Sync for NumaAllocTracker
impl Unpin for NumaAllocTracker
impl UnsafeUnpin for NumaAllocTracker
impl UnwindSafe for NumaAllocTracker
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