Skip to main content

available_parallelism

Function available_parallelism 

Source
pub fn available_parallelism() -> usize
Expand description

Return a best-effort CPU count available to the current process.

This first tries an OS-standard process-affinity query when supported, then falls back to std::thread::available_parallelism(), and finally to 1.

ยงExamples

let available = tenferro_tensor::cpu::available_parallelism();
assert!(available >= 1);