pub struct NumaBuffer { /* private fields */ }Expand description
Host-side descriptor for a host allocation bound to a NUMA node.
Records the bound node and the byte footprint. This models the result of a
numa_alloc_onnode(byte_size, node) followed by cuMemHostRegister; the
descriptor carries the accounting that callers use to verify locality
without owning a real pointer here.
Implementations§
Source§impl NumaBuffer
impl NumaBuffer
Sourcepub fn on_node(
topology: &NumaTopology,
node: usize,
byte_size: usize,
) -> CudaResult<Self>
pub fn on_node( topology: &NumaTopology, node: usize, byte_size: usize, ) -> CudaResult<Self>
Plans a NUMA-bound host allocation of byte_size bytes on node.
§Errors
CudaError::InvalidValueifbyte_sizeis zero ornodeis not a valid index intopology.
Sourcepub fn closest_to_gpu(
topology: &NumaTopology,
gpu_home_node: usize,
byte_size: usize,
) -> CudaResult<Self>
pub fn closest_to_gpu( topology: &NumaTopology, gpu_home_node: usize, byte_size: usize, ) -> CudaResult<Self>
Plans a host allocation bound to the node closest to a GPU whose home
node is gpu_home_node.
§Errors
Forwards errors from closest_node_to_gpu and the byte-size /
node-range checks.
Sourcepub fn is_local_to(&self, access_node: usize) -> bool
pub fn is_local_to(&self, access_node: usize) -> bool
Returns true if this allocation is local to access_node (i.e. the
accessing node is the bound node).
Sourcepub fn access_distance(
&self,
topology: &NumaTopology,
access_node: usize,
) -> Option<u8>
pub fn access_distance( &self, topology: &NumaTopology, access_node: usize, ) -> Option<u8>
Returns the NUMA distance an access from access_node would incur,
according to topology.
Returns None if access_node is out of range for topology.
Trait Implementations§
Source§impl Clone for NumaBuffer
impl Clone for NumaBuffer
Source§fn clone(&self) -> NumaBuffer
fn clone(&self) -> NumaBuffer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for NumaBuffer
Source§impl Debug for NumaBuffer
impl Debug for NumaBuffer
Source§impl Display for NumaBuffer
impl Display for NumaBuffer
impl Eq for NumaBuffer
Source§impl PartialEq for NumaBuffer
impl PartialEq for NumaBuffer
Source§fn eq(&self, other: &NumaBuffer) -> bool
fn eq(&self, other: &NumaBuffer) -> bool
self and other values to be equal, and is used by ==.