MeVisLab Toolbox Reference
|
Singleton class that provides hardware-specific information. More...
#include <mlCPUInfo.h>
Public Member Functions | |
bool | isPentium () const |
Returns true if this is a Pentium based system. More... | |
bool | hasMMX () const |
Returns true if MMX is supported. More... | |
bool | hasSSE () const |
Returns true if SSE is supported. More... | |
bool | hasSSE2 () const |
Returns true if SSE2 is supported. More... | |
bool | hasSSE3 () const |
Returns true if SSE3 is supported. More... | |
bool | hasSSSE3 () const |
Returns true if SSSE3 is supported. More... | |
bool | hasSSE4_1 () const |
Returns true if SSE4.1 is supported. More... | |
bool | hasSSE4_2 () const |
Returns true if SSE4.2 is supported. More... | |
bool | hasSSE4a () const |
Returns true if SSE4a is supported. More... | |
bool | hasSSE5 () const |
Returns true if SSE5 is supported. More... | |
bool | hasAVX () const |
Returns true if AVX is supported. More... | |
bool | has3DNow () const |
Returns true if 3DNow! is supported. More... | |
bool | has3DNowP () const |
Returns true if 3DNow+ is supported. More... | |
void | getCacheSizes (unsigned int &csize_l1, unsigned int &csize_l2) const |
Returns L1 and L2 cache sizes. More... | |
const std::string & | getVendorID () const |
Returns the CPU's vendor identifier ('AuthenticAMD' for example). More... | |
const std::string & | getModelID () const |
Returns the CPU's model identifier if supported. More... | |
void | getCPUCount (unsigned int &numPhysicalProcessors, unsigned int &numCores, unsigned int &numVirtualProcessors) |
Returns the machine's CPU configuration; that means the number of actual CPUs, the number of cores, and the total number of processors. More... | |
unsigned int | getNumPhysicalProcessors () const |
Returns the total number of actual CPUs. More... | |
unsigned int | getNumCores () const |
Returns the total number of cores. More... | |
unsigned int | getNumVirtualProcessors () const |
Returns the total number of virtual processors. More... | |
unsigned int | getCPUFrequency () const |
Returns the CPU frequency in megahertz. More... | |
void | printInfo (std::ostream &ostr) |
Formated output of system information to stdout. More... | |
Static Public Member Functions | |
static CPUInfo & | getInstance () |
Returns the single existing object of this class. More... | |
Protected Member Functions | |
CPUInfo () | |
This constructor must not be called from anywhere else but the getInstance() method (which does call this function if the static pointer to the valid object is not set yet). More... | |
Singleton class that provides hardware-specific information.
To get a pointer to a valid object of this type, use the getInstance() method. The getCPUCount method is required to get an overview of the machines CPU resources. There are different layers that influence the performance if used for multithreading. The lowest level is Hyper-Threading (two or more threads running on one core). Those threads share a lot more resources than threads running on different cores. Again those share resources (cache for example) that threads on different CPUs share. This hierarchy can give information on the quality of parallelization. A lot of valuable information can be found on this page: https://www.sandpile.org/x86/cpuid.htm or in the "Intel® Processor Identification and the CPUID Instruction". I tried to find an optimal way for providing information, but not having to struggle too much with Intel's way to mystify data. Therefore, there is primary use of the extended registers that provide lots of information in a more sane fashion.
Definition at line 42 of file mlCPUInfo.h.
|
protected |
This constructor must not be called from anywhere else but the getInstance() method (which does call this function if the static pointer to the valid object is not set yet).
void ml::CPUInfo::getCacheSizes | ( | unsigned int & | csize_l1, |
unsigned int & | csize_l2 | ||
) | const |
Returns L1 and L2 cache sizes.
void ml::CPUInfo::getCPUCount | ( | unsigned int & | numPhysicalProcessors, |
unsigned int & | numCores, | ||
unsigned int & | numVirtualProcessors | ||
) |
Returns the machine's CPU configuration; that means the number of actual CPUs, the number of cores, and the total number of processors.
numPhysicalProcessors | The total number of actual CPUs. |
numCores | The total number of cores. |
numVirtualProcessors | The total number of virtual processors. |
unsigned int ml::CPUInfo::getCPUFrequency | ( | ) | const |
Returns the CPU frequency in megahertz.
|
static |
Returns the single existing object of this class.
The concept of this class is based on the Singleton design pattern, which ensures there is only one object of this class. (NOT THREAD-SAFE!)
|
inline |
Returns the CPU's model identifier if supported.
Definition at line 126 of file mlCPUInfo.h.
unsigned int ml::CPUInfo::getNumCores | ( | ) | const |
Returns the total number of cores.
unsigned int ml::CPUInfo::getNumPhysicalProcessors | ( | ) | const |
Returns the total number of actual CPUs.
unsigned int ml::CPUInfo::getNumVirtualProcessors | ( | ) | const |
Returns the total number of virtual processors.
|
inline |
Returns the CPU's vendor identifier ('AuthenticAMD' for example).
Definition at line 122 of file mlCPUInfo.h.
|
inline |
Returns true
if 3DNow! is supported.
Definition at line 108 of file mlCPUInfo.h.
|
inline |
Returns true
if 3DNow+ is supported.
Definition at line 112 of file mlCPUInfo.h.
|
inline |
Returns true
if AVX is supported.
Definition at line 104 of file mlCPUInfo.h.
|
inline |
Returns true
if MMX is supported.
Definition at line 68 of file mlCPUInfo.h.
|
inline |
Returns true
if SSE is supported.
Definition at line 72 of file mlCPUInfo.h.
|
inline |
Returns true
if SSE2 is supported.
Definition at line 76 of file mlCPUInfo.h.
|
inline |
Returns true
if SSE3 is supported.
Definition at line 80 of file mlCPUInfo.h.
|
inline |
Returns true
if SSE4.1 is supported.
Definition at line 88 of file mlCPUInfo.h.
|
inline |
Returns true
if SSE4.2 is supported.
Definition at line 92 of file mlCPUInfo.h.
|
inline |
Returns true
if SSE4a is supported.
Definition at line 96 of file mlCPUInfo.h.
|
inline |
Returns true
if SSE5 is supported.
Definition at line 100 of file mlCPUInfo.h.
|
inline |
Returns true
if SSSE3 is supported.
Definition at line 84 of file mlCPUInfo.h.
|
inline |
Returns true
if this is a Pentium based system.
Definition at line 64 of file mlCPUInfo.h.
void ml::CPUInfo::printInfo | ( | std::ostream & | ostr | ) |
Formated output of system information to stdout.