pub struct GpuTopology {
pub device_count: usize,
pub numa_nodes: Vec<Option<u32>>,
pub probed: bool,
pub last_updated: Instant,
/* private fields */
}Expand description
GPU topology graph describing all device interconnections.
Fields§
§device_count: usizeNumber of devices in topology.
numa_nodes: Vec<Option<u32>>NUMA node assignments for each device.
probed: boolWhether topology has been probed (vs estimated).
last_updated: InstantTimestamp of last topology update.
Implementations§
Source§impl GpuTopology
impl GpuTopology
Sourcepub fn set_connection(&mut self, connection: GpuConnection)
pub fn set_connection(&mut self, connection: GpuConnection)
Set connection between two devices.
Sourcepub fn get_connection(
&self,
source: usize,
destination: usize,
) -> Option<&GpuConnection>
pub fn get_connection( &self, source: usize, destination: usize, ) -> Option<&GpuConnection>
Get connection between two devices.
Sourcepub fn best_path(&self, source: usize, destination: usize) -> Vec<usize>
pub fn best_path(&self, source: usize, destination: usize) -> Vec<usize>
Get best path between two devices (returns intermediate hops).
Sourcepub fn neighbors(&self, device: usize) -> Vec<usize>
pub fn neighbors(&self, device: usize) -> Vec<usize>
Get all devices directly connected to a device.
Sourcepub fn bisection_bandwidth_gbps(&self) -> f64
pub fn bisection_bandwidth_gbps(&self) -> f64
Calculate total bisection bandwidth of the topology.
Sourcepub fn is_fully_connected(&self) -> bool
pub fn is_fully_connected(&self) -> bool
Check if all devices have P2P connectivity.
Sourcepub fn numa_neighbors(&self, device: usize) -> Vec<usize>
pub fn numa_neighbors(&self, device: usize) -> Vec<usize>
Get devices in the same NUMA domain.
Sourcepub fn set_numa_node(&mut self, device: usize, numa_node: u32)
pub fn set_numa_node(&mut self, device: usize, numa_node: u32)
Set NUMA node for a device.
Sourcepub fn mark_probed(&mut self)
pub fn mark_probed(&mut self)
Mark topology as probed (not estimated).
Trait Implementations§
Source§impl Clone for GpuTopology
impl Clone for GpuTopology
Source§fn clone(&self) -> GpuTopology
fn clone(&self) -> GpuTopology
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GpuTopology
impl RefUnwindSafe for GpuTopology
impl Send for GpuTopology
impl Sync for GpuTopology
impl Unpin for GpuTopology
impl UnwindSafe for GpuTopology
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.