#include <mlCPUInfo.h>
Public Member Functions | |
| bool | isPentium () const |
Returns true if this is a pentium based system. | |
| bool | hasMMX () const |
Returns true if MMX is supported. | |
| bool | hasSSE () const |
Returns true if SSE is supported. | |
| bool | hasSSE2 () const |
Returns true if SSE2 is supported. | |
| bool | hasSSE3 () const |
Returns true if SSE3 is supported. | |
| bool | hasSSSE3 () const |
Returns true if SSSE3 is supported. | |
| bool | hasSSE4_1 () const |
Returns true if SSE4.1 is supported. | |
| bool | hasSSE4_2 () const |
Returns true if SSE4.2 is supported. | |
| bool | hasSSE4a () const |
Returns true if SSE4a is supported. | |
| bool | hasSSE5 () const |
Returns true if SSE5 is supported. | |
| bool | hasAVX () const |
Returns true if AVX is supported. | |
| bool | has3DNow () const |
Returns true if 3DNow! is supported. | |
| bool | has3DNowP () const |
Returns true if 3DNow+ is supported. | |
| void | getCacheSizes (unsigned int &csize_l1, unsigned int &csize_l2) const |
| Returns L1 and L2 cache sizes. | |
| const std::string & | getVendorID () const |
| Returns the CPU's vendor identifier (something like "AuthenticAMD" for example). | |
| const std::string & | getModelID () const |
| Returns the CPU's model identifier if supported. | |
| void | getCPUCount (unsigned int &numPhysicalProcessors, unsigned int &numCores, unsigned int &numVirtualProcessors) |
| Returns the machines CPU configuration, that means the number of actual CPUs, the number of cores and the total number of processors. | |
| unsigned int | getNumPhysicalProcessors () const |
| Returns the total number of actual CPUs. | |
| unsigned int | getNumCores () const |
| Returns the total number of cores. | |
| unsigned int | getNumVirtualProcessors () const |
| Returns the total number of virtual processors. | |
| void | printInfo (std::ostream &ostr) |
| Formated output of system information to stdout. | |
Static Public Member Functions | |
| static CPUInfo & | getInstance () |
| Returns the single existing object of this class. | |
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). | |
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 ressources. There are different layers which influence the performance if used for multithreading. The lowest level would be Hyper-Threading (two or more threads running on one core. Those share a lot more ressources than threads running on different cores. Again those share ressources (cache for example) that threads on different CPUs would share. This hierarchy can give information on the quality of parallelization. Information about the IA-32 platform can be read via the cpuid command. A lot of valuable information can be found on this page: http://www.sandpile.org/ia32/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 37 of file mlCPUInfo.h.
| ml::CPUInfo::CPUInfo | ( | ) | [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 machines 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. |
| static CPUInfo& ml::CPUInfo::getInstance | ( | ) | [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 THREADSAFE!)
| const std::string& ml::CPUInfo::getModelID | ( | ) | const [inline] |
| 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.
| const std::string& ml::CPUInfo::getVendorID | ( | ) | const [inline] |
Returns the CPU's vendor identifier (something like "AuthenticAMD" for example).
Definition at line 117 of file mlCPUInfo.h.
| bool ml::CPUInfo::has3DNow | ( | ) | const [inline] |
| bool ml::CPUInfo::has3DNowP | ( | ) | const [inline] |
| bool ml::CPUInfo::hasAVX | ( | ) | const [inline] |
| bool ml::CPUInfo::hasMMX | ( | ) | const [inline] |
| bool ml::CPUInfo::hasSSE | ( | ) | const [inline] |
| bool ml::CPUInfo::hasSSE2 | ( | ) | const [inline] |
| bool ml::CPUInfo::hasSSE3 | ( | ) | const [inline] |
| bool ml::CPUInfo::hasSSE4_1 | ( | ) | const [inline] |
| bool ml::CPUInfo::hasSSE4_2 | ( | ) | const [inline] |
| bool ml::CPUInfo::hasSSE4a | ( | ) | const [inline] |
| bool ml::CPUInfo::hasSSE5 | ( | ) | const [inline] |
| bool ml::CPUInfo::hasSSSE3 | ( | ) | const [inline] |
| bool ml::CPUInfo::isPentium | ( | ) | const [inline] |
| void ml::CPUInfo::printInfo | ( | std::ostream & | ostr | ) |
Formated output of system information to stdout.
1.5.8