qsdr_benchmarks/
lib.rs

1pub mod affinity {
2    use anyhow::Result;
3
4    pub fn get_core_ids() -> Result<Vec<core_affinity::CoreId>> {
5        let core_ids = core_affinity::get_core_ids()
6            .ok_or_else(|| anyhow::anyhow!("could not get CPU cores for affinity"))?;
7        anyhow::ensure!(
8            !core_ids.is_empty(),
9            "did not get any CPU cores for affinity"
10        );
11        Ok(core_ids)
12    }
13
14    // pin to a single CPU to prevent seeing jumps in get_cpu_cycles
15    // (pmccntr_el0 under aarch64) if we get migrated to another CPU
16    pub fn pin_cpu() -> Result<()> {
17        core_affinity::set_for_current(get_core_ids()?[0]);
18        Ok(())
19    }
20}
21
22pub mod asm;
23mod buffer;
24pub use buffer::Buffer;
25pub mod futures;