support/
support.rs

1extern crate hwloc;
2
3use hwloc::Topology;
4
5/// Example on how to check for specific topology support of a feature.
6fn main() {
7    let topo = Topology::new();
8
9    // Check if Process Binding for CPUs is supported
10    println!("CPU Binding (current process) supported: {}",
11             topo.support().cpu().set_current_process());
12    println!("CPU Binding (any process) supported: {}",
13             topo.support().cpu().set_process());
14
15    // Check if Thread Binding for CPUs is supported
16    println!("CPU Binding (current thread) supported: {}",
17             topo.support().cpu().set_current_thread());
18    println!("CPU Binding (any thread) supported: {}",
19             topo.support().cpu().set_thread());
20
21    // Check if Memory Binding is supported
22    println!("Memory Binding supported: {}",
23             topo.support().memory().set_current_process());
24
25    // Debug Print all the Support Flags
26    println!("All Flags:\n{:?}", topo.support());
27}