Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Functions | Variables
topology Namespace Reference

Classes

struct  ApicField
 
struct  CpuTopology
 
class  CacheRelations
 
struct  CacheTopology
 

Functions

static size_t MaxCoresPerPackage ()
 
static size_t MaxLogicalPerCore ()
 
static size_t MaxLogicalPerCache ()
 
static Status InitCpuTopology ()
 
size_t NumPackages ()
 
size_t CoresPerPackage ()
 
size_t LogicalPerCore ()
 
size_t LogicalFromApicId (ApicId apicId)
 
size_t CoreFromApicId (ApicId apicId)
 
size_t PackageFromApicId (ApicId apicId)
 
ApicId ApicIdFromIndices (size_t idxPackage, size_t idxCore, size_t idxLogical)
 
static void DetermineCachesProcessorMask (uintptr_t *cachesProcessorMask, size_t &numCaches)
 
static void DetermineProcessorsCache (const uintptr_t *cachesProcessorMask, size_t numCaches, size_t *processorsCache, size_t numProcessors)
 
static Status InitCacheTopology ()
 
size_t NumCaches ()
 
size_t CacheFromProcessor (size_t processor)
 
uintptr_t ProcessorMaskFromCache (size_t cache)
 

Variables

static CpuTopology cpuTopology
 
static ModuleInitState cpuInitState
 
static CacheTopology cacheTopology
 
static ModuleInitState cacheInitState
 

Function Documentation

LIB_API ApicId topology::ApicIdFromIndices ( size_t  idxPackage,
size_t  idxCore,
size_t  idxLogical 
)
Parameters
idxPackage,idxCore,idxLogicalreturn values of *FromApicId
Returns
APIC ID (see note at AreApicIdsReliable)

Definition at line 281 of file topology.cpp.

LIB_API size_t topology::CacheFromProcessor ( size_t  processor)
Returns
L2 cache number (zero-based) to which the given processor belongs.

Definition at line 460 of file topology.cpp.

LIB_API size_t topology::CoreFromApicId ( ApicId  apicId)
Returns
index of processor core in [0, CoresPerPackage())

Definition at line 268 of file topology.cpp.

LIB_API size_t topology::CoresPerPackage ( )
Returns
number of enabled CPU cores per package. (2 on dual-core systems)

Definition at line 250 of file topology.cpp.

static void topology::DetermineCachesProcessorMask ( uintptr_t *  cachesProcessorMask,
size_t &  numCaches 
)
static

Definition at line 387 of file topology.cpp.

static void topology::DetermineProcessorsCache ( const uintptr_t *  cachesProcessorMask,
size_t  numCaches,
size_t *  processorsCache,
size_t  numProcessors 
)
static

Definition at line 416 of file topology.cpp.

static Status topology::InitCacheTopology ( )
static

Definition at line 446 of file topology.cpp.

static Status topology::InitCpuTopology ( )
static

Definition at line 154 of file topology.cpp.

LIB_API size_t topology::LogicalFromApicId ( ApicId  apicId)
Returns
index of logical processor in [0, LogicalPerCore())

Definition at line 262 of file topology.cpp.

LIB_API size_t topology::LogicalPerCore ( )
Returns
number of enabled logical processors (aka Hyperthreads) per core. (2 on P4 EE)

Definition at line 256 of file topology.cpp.

static size_t topology::MaxCoresPerPackage ( )
static

Definition at line 48 of file topology.cpp.

static size_t topology::MaxLogicalPerCache ( )
static

Definition at line 114 of file topology.cpp.

static size_t topology::MaxLogicalPerCore ( )
static

Definition at line 77 of file topology.cpp.

LIB_API size_t topology::NumCaches ( )
Returns
number of distinct L2 caches.

Definition at line 454 of file topology.cpp.

LIB_API size_t topology::NumPackages ( )
Returns
number of enabled CPU packages / sockets.

Definition at line 244 of file topology.cpp.

LIB_API size_t topology::PackageFromApicId ( ApicId  apicId)
Returns
index of processor package/socket in [0, NumPackages())

Definition at line 274 of file topology.cpp.

LIB_API uintptr_t topology::ProcessorMaskFromCache ( size_t  cache)
Returns
bit-mask of all processors sharing the given cache.

Definition at line 467 of file topology.cpp.

Variable Documentation

ModuleInitState topology::cacheInitState
static

Definition at line 444 of file topology.cpp.

CacheTopology topology::cacheTopology
static

Definition at line 443 of file topology.cpp.

ModuleInitState topology::cpuInitState
static

Definition at line 152 of file topology.cpp.

CpuTopology topology::cpuTopology
static

Definition at line 151 of file topology.cpp.