Cpuid C++-APIs

Contents

Cpuid C++-APIs#

X86Cpu(CpuidUtils *cUtils, CpuNumT num)#
X86Cpu(CpuNumT num = UINT32_MAX)#

Default constructor.

Note

Default behaviour is invoked by passing AU_CURRENT_CPU_NUM, In default behaviour the thread is not pinned to any core, cpuid fetches the current thread on which the code is running.

Returns:

None

~X86Cpu()#
bool isAMD() const#

Check if vendor is AMD.

Returns:

true if ‘num’ was an AMD x86-64, false otherwise

bool isX86_64v2() const#

Checks if processor is x86_64-v2 compliant.

Based on GCC following flags account for x86_64-v2

       cx16       lahf_lm
       popcnt     sse4_1
       sse4_2     ssse3

Parameters:

none –

Returns:

true if cpu supports all features above, false otherwise

bool isX86_64v3() const#

Checks if processor is x86_64-v3 compliant.

Based on GCC following flags account for x86_64-v3

       (in addition to x86_64-v2)

       avx    avx2    bmi1
       bmi2   f16c    fma
       abm    movbe   xsave

Parameters:

none –

Returns:

true if cpu supports all features above, false otherwise

bool isX86_64v4() const#

Checks if processor is x86_64-v4 compliant.

Based on GCC following flags account for x86_64-v4

       (in addition to x86_64-v2 + x86_64-v3)
       avx512f   avx512bw  avx512cd
       avx512dq  avx512vl

Parameters:

none –

Returns:

true if cpu supports all features above, false otherwise

bool isIntel() const#

Check if vendor is Intel.

Parameters:

none –

Returns:

true if ‘num’ was an Intel x86-64, false otherwise

bool hasFlag(ECpuidFlag const &eflag) const#

Check if a given x86 cpu has a needed flag.

Parameters:

eflag – [in] ECpuidFlag that needs to be checked

Returns:

true if eflag is present in the availableflags and usable flags, false otherwise

bool isAvailable(ECpuidFlag const &eflag) const#

Check if a given x86 cpu has a needed flag.

       Note: The api is deprecated. Use hasFlag instead.
Parameters:

eflag – [in] ECpuidFlag that needs to be checked

Returns:

true if eflag is present in the availableflags and usable flags, false otherwise

EUarch getUarch() const#

Get microarchitecture of CPU from CPUID instruction.

Parameters:

none –

Returns:

Returns microarchitecture of CPU.

bool isUarch(EUarch uarch, bool strict = false) const#

Checks microarchitecture from CPUID instruction and compare with input Like Zen, Zen2, Zen3 etc.

Parameters:
  • arch – [in] Microarchitecture input to check for.

  • strict – [in] If true, then exact match is checked.

Returns:

Returns true if CPU microarchitecture is matched with input.

VendorInfo getVendorInfo() const#

Get the VendorInfo object.

Parameters:

none –

Returns:

VendorInfo

void update()#

Re-read all the cpuid functions and upate internal structures.

Parameters:

none –

Returns:

none

inline virtual EGoverner getGoverner() const override#

Interface to get Freqency scaling governer.

Returns:

EGoverner type

CacheView getCacheView() const#
enum class Au::ECpuidFlag : Uint64#

Flags supported by CPU as features.

Values:

enumerator Min#
enumerator sse3#
enumerator pclmulqdq#
enumerator dtes64#
enumerator monitor#
enumerator dscpl#
enumerator vmx#
enumerator smx#
enumerator est#
enumerator tm2#
enumerator ssse3#
enumerator cid#
enumerator fma#
enumerator cx16#
enumerator xtpr#
enumerator pdcm#
enumerator pcid#
enumerator dca#
enumerator sse4_1#
enumerator sse4_2#
enumerator x2apic#
enumerator movbe#
enumerator popcnt#
enumerator tsc_deadline#
enumerator aes#
enumerator xsave#
enumerator osxsave#
enumerator avx#
enumerator f16c#
enumerator rdrand#
enumerator hypervisor#
enumerator fpu#
enumerator vme#
enumerator de#
enumerator pse#
enumerator tsc#
enumerator msr#
enumerator pae#
enumerator mce#
enumerator cx8#
enumerator apic#
enumerator sep#
enumerator mtrr#
enumerator pge#
enumerator mca#
enumerator cmov#
enumerator pat#
enumerator pse36#
enumerator pn#
enumerator clflush#
enumerator ds#
enumerator acpi#
enumerator mmx#
enumerator fxsr#
enumerator sse#
enumerator sse2#
enumerator ss#
enumerator ht#
enumerator tm#
enumerator ia64#
enumerator pbe#
enumerator arat#
enumerator fsgsbase#
enumerator tsc_adjust#
enumerator bmi1#
enumerator hle#
enumerator avx2#
enumerator smep#
enumerator bmi2#
enumerator erms#
enumerator invpcid#
enumerator rtm#
enumerator mpx#
enumerator avx512f#
enumerator avx512dq#
enumerator rdseed#
enumerator adx#
enumerator smap#
enumerator avx512ifma#
enumerator pcommit#
enumerator clflushopt#
enumerator clwb#
enumerator avx512pf#
enumerator avx512er#
enumerator avx512cd#
enumerator sha_ni#
enumerator avx512bw#
enumerator avx512vl#
enumerator avx512vbmi#
enumerator umip#
enumerator pku#
enumerator ospke#
enumerator avx512_vpopcntdq#
enumerator la57#
enumerator rdpid#
enumerator avx512_4vnniw#
enumerator avx512_4fmaps#
enumerator avx512_bf16#
enumerator avxvnni#
enumerator xsaveopt#
enumerator xsavec#
enumerator xgetbv1#
enumerator xsaves#
enumerator lahf_lm#
enumerator cmp_legacy#
enumerator svm#
enumerator extapic#
enumerator cr8legacy#
enumerator abm#
enumerator sse4a#
enumerator misalignsse#
enumerator _3dnowprefetch#
enumerator osvw#
enumerator ibs#
enumerator xop#
enumerator skinit#
enumerator wdt#
enumerator lwp#
enumerator fma4#
enumerator tce#
enumerator nodeid_msr#
enumerator tbm#
enumerator topoext#
enumerator perfctr_core#
enumerator perfctr_nb#
enumerator syscall#
enumerator nxxd#
enumerator mmxext#
enumerator fxsr_opt#
enumerator pdpe1gb#
enumerator rdtscp#
enumerator lmi64#
enumerator _3dnowext#
enumerator _3dnow#
enumerator invtsc#
enumerator npt#
enumerator lbrv#
enumerator svm_lock#
enumerator nrip_save#
enumerator tsc_scale#
enumerator vmcb_clean#
enumerator flushbyasid#
enumerator decodeassists#
enumerator pause_filter#
enumerator pfthreshold#
enumerator xstore#
enumerator xstore_en#
enumerator xcrypt#
enumerator xcrypt_en#
enumerator ace2#
enumerator ace2_en#
enumerator phe#
enumerator phe_en#
enumerator pmm#
enumerator pmm_en#
enumerator vaes#
enumerator vpclmulqdq#
enumerator avx512_vnni#
enumerator avx512_bitalg#
enumerator avx512vbmi2#
enumerator movdiri#
enumerator movdir64b#
enumerator avx512_vpintersect#
enumerator x2avic#
enumerator Max#