X_CPUID_VERSION_MAJOR
#define X_CPUID_VERSION_MAJOR 1
STDX - IO (file I/O utility functions) Part of the STDX General Purpose C Library by marciovmf License: MIT https://github.com/marciovmf/stdx
This module provides access to basic, read-only information about the host CPU as detected at runtime.
To compile the implementation define X_IMPL_CPUID
in one source file before including this header.
#define X_CPUID_VERSION_MAJOR 1
#define X_CPUID_VERSION_MINOR 0
#define X_CPUID_VERSION_PATCH 0
#define X_CPUID_VERSION(X_CPUID_VERSION_MAJOR *10000+X_CPUID_VERSION_MINOR *100+X_CPUID_VERSION_PATCH)
#define X_CPUID_SUPPORTED 1
#define X_CPUID_SUPPORTED 0
typedef enum{
CPU_FEATURE_NONE=0,
CPU_FEATURE_SSE=1<<0,
CPU_FEATURE_SSE2=1<<1,
CPU_FEATURE_SSE3=1<<2,
CPU_FEATURE_SSSE3=1<<3,
CPU_FEATURE_SSE41=1<<4,
CPU_FEATURE_SSE42=1<<5,
CPU_FEATURE_AVX=1<<6,
CPU_FEATURE_AVX2=1<<7,
CPU_FEATURE_AVX512F=1<<8,
CPU_FEATURE_NEON=1<<16,
CPU_FEATURE_AES=1<<17,
CPU_FEATURE_CRC32=1<<18,
}CPUFeature;
typedef struct{
int logical_cpus;
int physical_cores;
int sockets;
bool hyperthreading;
int cache_size_l1_kb;
int cache_size_l2_kb;
int cache_size_l3_kb;
char brand_string[49];
CPUFeature feature_flags;
}XCPUInfo;
Query static information about the host CPU. All data is gathered once per call and returned by value. The caller owns the returned structure and no dynamic memory is involved.
X_CPUID_API XCPUInfo x_cpu_info(void);
Structure containing CPU topology, cache sizes, brand string, and supported feature flags.