102 [[nodiscard]]
auto get_distance(
int node1,
int node2)
const -> int;
110 [[nodiscard]]
auto is_same_node(
int cpu1,
int cpu2)
const -> bool;
NUMA (Non-Uniform Memory Access) topology information.
std::size_t total_cpus_
Total CPU count.
numa_topology()=default
Default constructor - creates an empty topology.
auto get_nodes() const -> const std::vector< numa_node > &
Get all NUMA nodes.
static auto detect() -> numa_topology
Detect and return the system's NUMA topology.
auto get_cpus_for_node(int node_id) const -> std::vector< int >
Get CPUs belonging to a specific node.
auto get_distance(int node1, int node2) const -> int
Get the distance between two NUMA nodes.
auto get_node_for_cpu(int cpu_id) const -> int
Get the NUMA node for a given CPU.
std::vector< std::vector< int > > distances_
Inter-node distances.
std::vector< numa_node > nodes_
All NUMA nodes.
auto is_numa_available() const -> bool
Check if NUMA is available on this system.
static auto detect_linux() -> numa_topology
Detect topology on Linux using sysfs.
std::vector< int > cpu_to_node_
CPU ID -> NUMA node mapping.
auto cpu_count() const -> std::size_t
Get the total number of CPUs.
static auto create_fallback() -> numa_topology
Create fallback single-node topology.
auto node_count() const -> std::size_t
Get the number of NUMA nodes.
auto is_same_node(int cpu1, int cpu2) const -> bool
Check if two CPUs are on the same NUMA node.
Core threading foundation of the thread system library.
Information about a single NUMA node.
std::vector< int > cpu_ids
CPUs belonging to this node.
std::size_t memory_size_bytes
Total memory on this node.
int node_id
NUMA node identifier.