Apache Arrow (C++)
A columnar in-memory analytics layer designed to accelerate big data.
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
arrow::CpuInfo Class Reference

CpuInfo is an interface to query for cpu information at runtime. More...

#include <arrow/util/cpu-info.h>

Public Types

enum  CacheLevel { L1_CACHE = 0, L2_CACHE = 1, L3_CACHE = 2 }
 Cache enums for L1 (data), L2 and L3. More...
 

Static Public Member Functions

static void Init ()
 Initialize CpuInfo. More...
 
static void VerifyCpuRequirements ()
 Determine if the CPU meets the minimum CPU requirements and if not, issue an error and terminate. More...
 
static int64_t hardware_flags ()
 Returns all the flags for this cpu. More...
 
static bool IsSupported (int64_t flag)
 Returns whether of not the cpu supports this flag. More...
 
static void EnableFeature (int64_t flag, bool enable)
 Toggle a hardware feature on and off. More...
 
static int64_t CacheSize (CacheLevel level)
 Returns the size of the cache in KB at this cache level. More...
 
static int64_t cycles_per_ms ()
 Returns the number of cpu cycles per millisecond. More...
 
static int num_cores ()
 Returns the number of cores (including hyper-threaded) on this machine. More...
 
static std::string model_name ()
 Returns the model name of the cpu (e.g. Intel i7-2600) More...
 
static bool initialized ()
 

Static Public Attributes

static const int64_t SSSE3 = (1 << 1)
 
static const int64_t SSE4_1 = (1 << 2)
 
static const int64_t SSE4_2 = (1 << 3)
 
static const int64_t POPCNT = (1 << 4)
 

Detailed Description

CpuInfo is an interface to query for cpu information at runtime.

The caller can ask for the sizes of the caches and what hardware features are supported. On Linux, this information is pulled from a couple of sys files (/proc/cpuinfo and /sys/devices)

Member Enumeration Documentation

◆ CacheLevel

Cache enums for L1 (data), L2 and L3.

Enumerator
L1_CACHE 
L2_CACHE 
L3_CACHE 

Member Function Documentation

◆ CacheSize()

static int64_t arrow::CpuInfo::CacheSize ( CacheLevel  level)
static

Returns the size of the cache in KB at this cache level.

◆ cycles_per_ms()

static int64_t arrow::CpuInfo::cycles_per_ms ( )
static

Returns the number of cpu cycles per millisecond.

◆ EnableFeature()

static void arrow::CpuInfo::EnableFeature ( int64_t  flag,
bool  enable 
)
static

Toggle a hardware feature on and off.

It is not valid to turn on a feature that the underlying hardware cannot support. This is useful for testing.

◆ hardware_flags()

static int64_t arrow::CpuInfo::hardware_flags ( )
static

Returns all the flags for this cpu.

◆ Init()

static void arrow::CpuInfo::Init ( )
static

Initialize CpuInfo.

◆ initialized()

static bool arrow::CpuInfo::initialized ( )
inlinestatic

◆ IsSupported()

static bool arrow::CpuInfo::IsSupported ( int64_t  flag)
inlinestatic

Returns whether of not the cpu supports this flag.

◆ model_name()

static std::string arrow::CpuInfo::model_name ( )
static

Returns the model name of the cpu (e.g. Intel i7-2600)

◆ num_cores()

static int arrow::CpuInfo::num_cores ( )
static

Returns the number of cores (including hyper-threaded) on this machine.

◆ VerifyCpuRequirements()

static void arrow::CpuInfo::VerifyCpuRequirements ( )
static

Determine if the CPU meets the minimum CPU requirements and if not, issue an error and terminate.

Member Data Documentation

◆ POPCNT

const int64_t arrow::CpuInfo::POPCNT = (1 << 4)
static

◆ SSE4_1

const int64_t arrow::CpuInfo::SSE4_1 = (1 << 2)
static

◆ SSE4_2

const int64_t arrow::CpuInfo::SSE4_2 = (1 << 3)
static

◆ SSSE3

const int64_t arrow::CpuInfo::SSSE3 = (1 << 1)
static

The documentation for this class was generated from the following file: