Rihen Rihen NkentseuDocumentation
Development version, not published. Built from main: it shows what is coming (fixes, descriptions written since the last tag) and can change with every commit. Go to the stable version 0.1.0-beta.11

CPUFeatures

struct

Complete structure of the detected CPU features

Include
#include "NKPlatform/NkCPUFeatures.h"
Namespace
nkentseu::platform
Link (Jenga)
nkentseudependson(["NKPlatform"])
C++
struct CPUFeatures

Hierarchy

Base classes : none. Derived classes : none.

Hierarchy : CPUFeaturesCPUFeatures

Members · 16

Members · 13

VENDOR_CAPACITYMaximum capacity of the vendor string
BRAND_CAPACITYMaximum capacity of the brand string
vendorVendor identification string
brandFull processor name (brand string)
familyCPU family number (CPUID)
modelCPU model number (CPUID)
steppingCPU stepping number (CPUID)
topologyTopology information
cacheCache information
simdSIMD features
extendedExtended features
baseFrequencyBase frequency in MHz
maxFrequencyMaximum frequency in MHz (Turbo)

CPUFeaturesAPI · 3

GetGets the singleton instance (lazy, thread-safe initialisation)
ToStringFormats the CPU information into a buffer provided by the caller
ToStringGets a convenient string representation (internal static buffer)

Member details

VENDOR_CAPACITY

#
variable
static constexpr size_t VENDOR_CAPACITY = 32u

Maximum capacity of the vendor string

BRAND_CAPACITY

#
variable
static constexpr size_t BRAND_CAPACITY = 128u

Maximum capacity of the brand string

vendor

#
field
char vendor[VENDOR_CAPACITY]

Vendor identification string

brand

#
field
char brand[BRAND_CAPACITY]

Full processor name (brand string)

family

#
field
int32_t family

CPU family number (CPUID)

model

#
field
int32_t model

CPU model number (CPUID)

stepping

#
field
int32_t stepping

CPU stepping number (CPUID)

topology

#
field
CPUTopology topology

Topology information

cache

#
field
CacheInfo cache

Cache information

simd

#
field
SIMDFeatures simd

SIMD features

extended

#
field
ExtendedFeatures extended

Extended features

baseFrequency

#
field
int32_t baseFrequency

Base frequency in MHz

maxFrequency

#
field
int32_t maxFrequency

Maximum frequency in MHz (Turbo)

Get

#
method
static const CPUFeatures &Get()

Gets the singleton instance (lazy, thread-safe initialisation)

ToString

#
method
void ToString(char *outBuffer, size_t outBufferSize) const

Formats the CPU information into a buffer provided by the caller

Parameters

NameTypeRoleDefault
outBufferchar *
outBufferSizesize_t

ToString

#
method
const char *ToString() const

Gets a convenient string representation (internal static buffer)

@codefragment, not compiled
// Usage rapide pour logging
NK_FOUNDATION_LOG_INFO("CPU: %s", CPUFeatures::Get().ToString());