| Ocean
    | 
This class implements basic functions relating the system processor. More...
#include <Processor.h>
| Public Member Functions | |
| unsigned int | cores () const | 
| Returns the number of available processor cores. | |
| ProcessorInstructions | instructions () | 
| Returns the supported instruction set of the processor. | |
| bool | forceCores (const unsigned int cores) | 
| Forces a user defined number of processor cores. | |
| bool | forceInstructions (const ProcessorInstructions instructions) | 
| Forces a user-defined processor instruction set. | |
| Static Public Member Functions | |
| static std::string | brand () | 
| Returns the processor's brand. | |
| static unsigned int | realCores () | 
| Returns the number of available processor cores currently detectable. | |
| static ProcessorInstructions | realInstructions () | 
| Returns the supported instruction set of the processor. | |
| static std::string | translateInstructions (const ProcessorInstructions instructions) | 
| Translates a set of processor instructions to a readable string. | |
| template<bool tIndependentOfBinary> | |
| static ProcessorInstructions | bestInstructionGroup (const ProcessorInstructions instructions) | 
| Returns the best group of instructions value for a set of given processor instructions. | |
| static bool | isLittleEndian () | 
| Returns whether the processor/system is using the little endian convention (like e.g., x86) or whether the big endian convention is used. | |
| static bool | virtualCountRegister (uint64_t &counter) | 
| Returns the current value of the ARM virtual count register cntvct_el0/cntpct_el0. | |
| static bool | virtualCountFrequency (uint64_t &frequency) | 
| Returns the frequency of the ARM virtual count register cntvct_el0/cntpct_el0 from the system counter frequency register cntfrq_el0. | |
| template<> | |
| ProcessorInstructions | bestInstructionGroup (const ProcessorInstructions instructions) | 
|  Static Public Member Functions inherited from Ocean::Singleton< Processor > | |
| static Processor & | get () | 
| Returns a reference to the unique object. | |
| Private Member Functions | |
| Processor () | |
| Constructs a new processor object. | |
| Static Private Member Functions | |
| static unsigned int | realCoresApple () | 
| Returns the number of available processor cores currently detectable. | |
| static std::string | deviceModelAppleIOS () | 
| Returns the device name of the Apple iOS device. | |
| static constexpr ProcessorInstructions | invalidProcessorInstructions () | 
| Returns invalid processor instructions. | |
| Private Attributes | |
| unsigned int | forcedCores_ = 0u | 
| Explicitly forced number of processor cores. | |
| ProcessorInstructions | forcedProcessorInstructions_ = invalidProcessorInstructions() | 
| Explicitly forced CPU instructions. | |
| ProcessorInstructions | processorInstructions_ = invalidProcessorInstructions() | 
| The real instructions of the processor. | |
| Lock | lock_ | 
| The lock of the processor class. | |
| Friends | |
| class | Singleton< Processor > | 
| Additional Inherited Members | |
|  Protected Member Functions inherited from Ocean::Singleton< Processor > | |
| Singleton ()=default | |
| Default constructor. | |
This class implements basic functions relating the system processor.
| 
 | private | 
Constructs a new processor object.
| 
 | inlinestatic | 
Returns the best group of instructions value for a set of given processor instructions.
The function may return the following groups in the following order: PI_GROUP_AVX_2_SSE_4_1, PI_GROUP_SSE_4_1, PI_GROUP_AVX_2_SSE_2, PI_GROUP_AVX_2, PI_GROUP_SSE_2, PI_GROUP_NEON.
| instructions | The set of instructions for which the best group will be returned | 
| tIndependentOfBinary | True, to return the best group without checking the binaries capabilities; False, to return groups which are supported by the current binary only | 
| 
 | inlinestatic | 
| 
 | static | 
Returns the processor's brand.
| 
 | inline | 
Returns the number of available processor cores.
If an explicit number of processors has been forced by the user, the user defined number will be returned.
| 
 | staticprivate | 
Returns the device name of the Apple iOS device.
| bool Ocean::Processor::forceCores | ( | const unsigned int | cores | ) | 
| bool Ocean::Processor::forceInstructions | ( | const ProcessorInstructions | instructions | ) | 
Forces a user-defined processor instruction set.
The forced instruction set will be returned instead of the real instruction set using the instructions() function.
| instructions | The instruction set to be forced, -1 to remove the previously forced instruction set | 
| 
 | inline | 
Returns the supported instruction set of the processor.
If an explicit instruction set has been forced by the user, the user defined instruction set will be returned.
| 
 | staticconstexprprivate | 
Returns invalid processor instructions.
| 
 | inlinestatic | 
Returns whether the processor/system is using the little endian convention (like e.g., x86) or whether the big endian convention is used.
| 
 | static | 
Returns the number of available processor cores currently detectable.
| 
 | staticprivate | 
Returns the number of available processor cores currently detectable.
| 
 | static | 
Returns the supported instruction set of the processor.
| 
 | static | 
Translates a set of processor instructions to a readable string.
| instructions | The instructions to be translated | 
| 
 | static | 
Returns the frequency of the ARM virtual count register cntvct_el0/cntpct_el0 from the system counter frequency register cntfrq_el0.
| frequency | The resulting frequency in Hz | 
| 
 | static | 
Returns the current value of the ARM virtual count register cntvct_el0/cntpct_el0.
The value returned is a monotonically increasing counter, typically used for high-resolution timing and performance measurements.
 To convert the counter value to seconds, divide the difference between two readings by the system counter frequency.
 The virtual count value is equal to the physical count value minus the virtual offset visible in cntvoff_el2. 
| counter | The resulting counter value | 
| 
 | private | 
Explicitly forced number of processor cores.
| 
 | private | 
Explicitly forced CPU instructions.
| 
 | mutableprivate | 
The lock of the processor class.
| 
 | private | 
The real instructions of the processor.