mirror of
https://github.com/sched-ext/scx.git
synced 2024-11-24 20:00:22 +00:00
scx_utils: Add cores helper to node topology
Add a helper for getting the cores per node. Signed-off-by: Daniel Hodges <hodges.daniel.scott@gmail.com>
This commit is contained in:
parent
cc3f696c4b
commit
f0c9a3932d
@ -265,6 +265,17 @@ impl Node {
|
||||
cpus
|
||||
}
|
||||
|
||||
/// Get the map of all Cores for this NUMA node.
|
||||
pub fn cores(&self) -> BTreeMap<usize, Core> {
|
||||
let mut cores = BTreeMap::new();
|
||||
for (_, llc) in &self.llcs {
|
||||
for (core_id, core) in llc.cores() {
|
||||
cores.insert(*core_id, core.clone());
|
||||
}
|
||||
}
|
||||
cores
|
||||
}
|
||||
|
||||
// Get the map of all GPUs for this NUMA node.
|
||||
pub fn gpus(&self) -> &BTreeMap<GpuIndex, Gpu> {
|
||||
&self.gpus
|
||||
|
Loading…
Reference in New Issue
Block a user