llvm::get_physical_cores

Return the number of physical cores on the host, or -1 if unknown.

Synopsis

Declared in <llvm/Support/Threading.h>

int
get_physical_cores();

Description

Unlike logical cores from thread::hardware_concurrency(), this count excludes hyperthreads.

Return Value

Physical core count, or -1 when the count cannot be determined.