LIKWID
Classes | Typedefs | Enumerations | Functions | Variables
CPU information module

Classes

struct  CacheLevel
 Structure describing a cache level. More...
 
struct  CpuInfo
 Structure with general CPU information. More...
 
struct  CpuTopology
 Structure describing the topology of the HW threads in the system. More...
 
struct  HWThread
 Structure with IDs of a HW thread. More...
 
struct  treeNode
 Structure of a tree node. More...
 

Typedefs

typedef CpuInfoCpuInfo_t
 Pointer for exporting the CpuInfo data structure.
 
typedef CpuTopologyCpuTopology_t
 Pointer for exporting the CpuTopology data structure.
 
typedef struct treeNode TreeNode
 Shorter name for struct treeNode.
 

Enumerations

enum  CacheType {
  NOCACHE =0, DATACACHE, INSTRUCTIONCACHE, UNIFIEDCACHE,
  ITLB, DTLB
}
 Enum of possible caches. More...
 
enum  FeatureBit {
  SSE3 =0, MMX, SSE, SSE2,
  MONITOR, ACPI, RDTSCP, VMX,
  EIST, TM, TM2, AES,
  RDRAND, SSSE3, SSE41, SSE42,
  AVX, FMA, AVX2, RTM,
  HLE, HTT, RDSEED, AVX512,
  SWP, VFP, NEON, EDSP,
  VFPV3, VFPV4, TLS
}
 Enum of possible CPU features. More...
 

Functions

CpuInfo_t get_cpuInfo (void) __attribute__((visibility("default")))
 Retrieve CPU information of the current machine. More...
 
CpuTopology_t get_cpuTopology (void) __attribute__((visibility("default")))
 Retrieve CPU topology of the current machine. More...
 
void print_supportedCPUs (void) __attribute__((visibility("default")))
 Print all supported architectures.
 
void topology_finalize (void) __attribute__((visibility("default")))
 Destroy topology structures CpuInfo_t and CpuTopology_t. More...
 
int topology_init (void) __attribute__((visibility("default")))
 Initialize topology information. More...
 

Variables

CpuInfo cpuid_info
 Variable holding the global cpu information structure.
 
CpuTopology cpuid_topology
 Variable holding the global cpu topology structure.
 

Detailed Description

Enumeration Type Documentation

enum CacheType

Enum of possible caches.

CPU caches can have different tasks and hold different kind of data. This enum lists all shapes used in all supported CPUs

Enumerator
NOCACHE 

No cache used as undef value.

DATACACHE 

Cache holding data cache lines.

INSTRUCTIONCACHE 

Cache holding instruction cache lines.

UNIFIEDCACHE 

Cache holding both instruction and data cache lines.

ITLB 

Translation Lookaside Buffer cache for instruction pages.

DTLB 

Translation Lookaside Buffer cache for data pages.

enum FeatureBit

Enum of possible CPU features.

CPUs implement different features that likely improve application performance if optimized using the feature. The list contains all features that are currently supported by LIKWID. LIKWID does not perform any action based on these features, it gathers the data only for output purposes. It is not a complete list.

Enumerator
SSE3 

Streaming SIMD Extensions 3.

MMX 

Multi Media Extension.

SSE 

Streaming SIMD Extensions.

SSE2 

Streaming SIMD Extensions 2.

MONITOR 

MONITOR and MWAIT instructions (part of SSE3)

ACPI 

Advanced Configuration and Power Interface.

RDTSCP 

Serializing Read of the Time Stamp Counter.

VMX 

Virtual Machine eXtensions (VT-x)

EIST 

Enhanced Intel SpeedStep.

TM 

Thermal Monitor.

TM2 

Thermal Monitor 2.

AES 

AES instruction set.

RDRAND 

Random numbers from an on-chip hardware random number generator.

SSSE3 

Supplemental Streaming SIMD Extensions 3.

SSE41 

Streaming SIMD Extensions 4.1.

SSE42 

Streaming SIMD Extensions 4.2.

AVX 

Advanced Vector Extensions.

FMA 

Fused multiply-add (FMA3)

AVX2 

Advanced Vector Extensions 2.

RTM 

Restricted Transactional Memory.

HLE 

Hardware Lock Elision.

HTT 

Hyper-Threading Technology.

RDSEED 

Non-deterministic random bit generator.

AVX512 

512-bit wide vector registers for Advanced Vector Extensions

SWP 

Atomic read-modify-write.

VFP 

First generation SIMD.

NEON 

Second generation SIMD.

EDSP 

DSP extensions.

VFPV3 

First generation SIMD Version 3.

VFPV4 

First generation SIMD Version 4.

TLS 

Thread-local storage registers.

Function Documentation

CpuInfo_t get_cpuInfo ( void  )

Retrieve CPU information of the current machine.

Get the previously initialized CPU info structure containing number of CPUs/Threads

See also
CpuInfo_t
Returns
CpuInfo_t (pointer to internal cpuid_info structure)
CpuTopology_t get_cpuTopology ( void  )

Retrieve CPU topology of the current machine.

See also
CpuTopology_t
Returns
CpuTopology_t (pointer to internal cpuid_topology structure)
void topology_finalize ( void  )

Destroy topology structures CpuInfo_t and CpuTopology_t.

Retrieved pointers to the structures are not valid anymore after this function call

See also
CpuInfo_t and CpuTopology_t
int topology_init ( void  )

Initialize topology information.

CpuInfo_t and CpuTopology_t are initialized by either HWLOC, CPUID/ProcFS or topology file if present. The topology file name can be configured in the configuration file. Furthermore, the paths /etc/likwid_topo.cfg and <PREFIX>/etc/likwid_topo.cfg are checked.

See also
CpuInfo_t and CpuTopology_t
Returns
always 0