92 JAU_MAKE_ENUM_STRING(
cpu_family_t,
arm32,
arm64,
x86_32,
x86_64,
ia64,
ppc32,
ppc64,
sparc32,
sparc64,
mips32,
mips64,
superh32,
superh64,
wasm32,
wasm64);
121 JAU_MAKE_BITFIELD_ENUM_STRING(
arm32_hwcap1_t,
swp,
half,
thumb,
bits26,
fmult,
fpa,
vfp,
edsp,
java,
iwmmxt,
174 JAU_MAKE_BITFIELD_ENUM_STRING(
arm64_hwcap_t,
fp,
asimd,
evtstrm,
aes,
pmull,
sha1,
sha2,
crc32,
atomics,
fphp,
175 asimdhp,
cpuid,
asimdrdm,
jscvt,
fcma,
lrcpc,
dcpop,
sha3,
sm3,
sm4,
176 asimddp,
sha512,
sve,
asimdfhm,
dit,
uscat,
ilrcpc,
flagm,
ssbs,
sb,
paca,
pacg);
215 CpuInfo(const CpuInfo&) = delete;
216 void operator=(const CpuInfo&) = delete;
219 static inline const CpuInfo&
get() noexcept {
229 std::string
toString(std::string&
sb,
bool details_only=
false) const noexcept;
size_t pointer_bits
See pointer_bit_size()
size_t sys_online_cores
Number of available/online cores from system call.
static const CpuInfo & get() noexcept
Returns reference to const singleton instance.
std::string toString() const noexcept
size_t l1_apart_min
Minimum offset between two objects to avoid false sharing if has_l1_minmax, or zero.
size_t online_core_count() const noexcept
Returns maximum number of available/online cores, i.e.
cpu_family_t family
cpu_family_t derived from Architectures predefined compiler macros.
bool has_l1_minmax
True if successfully queried l1_share_max and l1_apart_min.
arm32_hwcap1_t arm32_hwcap1
arm32_hwcap1_t info if available, i.e.
std::string toString(std::string &sb, bool details_only=false) const noexcept
bool has_arm32_hwcap
True if successfully queried arm32_hwcap1 and arm32_hwcap1 on cpu_family_t::arm32.
size_t sys_max_cores
Number of installed/configured cores from system call.
size_t page_size
Size of a page in bytes or zero if not available.
arm64_hwcap_t arm64_hwcap
arm64_hwcap_t info if available, i.e.
size_t l1_share_max
Maximum size of contiguous memory to promote true sharing if has_l1_minmax, or zero.
bool has_arm64_hwcap
True if successfully queried arm64_hwcap on cpu_family_t::arm64.
arm32_hwcap2_t arm32_hwcap2
arm32_hwcap2_t info if available, i.e.
size_t concurrent_threads
Number of available concurrent threads (cores) or zero if information is not available,...
endian_t
Endian identifier, indicating endianess of all scalar types.
#define JAU_MAKE_ENUM_STRING(type,...)
#define JAU_MAKE_BITFIELD_ENUM_STRING(type,...)
constexpr size_t pointer_bit_size() noexcept
Returns the compile time pointer architecture size in bits.
std::string get_cpu_info() noexcept
@ x86_64
AMD/Intel 64-bit.
@ x86_32
AMD/Intel 32-bit.
@ wasm64
WebAssembly 64-bit.
@ superh32
Hitachi SuperH 32bit.
@ superh64
Hitachi SuperH 64bit.
@ wasm32
WebAssembly 32-bit.
Author: Sven Gothel sgothel@jausoft.com Copyright Gothel Software e.K.