Macro

X_CPUID_VERSION_MAJOR

#define X_CPUID_VERSION_MAJOR 1
Macro

X_CPUID_VERSION_MINOR

#define X_CPUID_VERSION_MINOR 0
Macro

X_CPUID_VERSION_PATCH

#define X_CPUID_VERSION_PATCH 0
Macro

X_CPUID_SUPPORTED

#define X_CPUID_SUPPORTED 1
Macro

X_CPUID_SUPPORTED

#define X_CPUID_SUPPORTED 0
Enum

CPUFeature

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;
Struct

XCPUInfo

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;
Function

x_cpu_info

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);

Returns

Structure containing CPU topology, cache sizes, brand string, and supported feature flags.