Yeppp!
 All Classes Functions Variables Pages
Static Public Member Functions | List of all members
Library Class Reference

Non-computational functions for checking library version, quering information about processor, and benchmarking. More...

Static Public Member Functions

static native long getTimerTicks ()
 Queries the ticks count of the high-resolution system timer. More...
 
static native long getTimerFrequency ()
 Queries the frequency (number of ticks per second) of the high-resolution system timer. More...
 
static native long getTimerAccuracy ()
 Detects the minimum time difference in nanoseconds which can be measured by the high-resolution system timer. More...
 
static CpuVendor getCpuVendor ()
 Returns information about the vendor of the processor. More...
 
static CpuArchitecture getCpuArchitecture ()
 Provides information about the architecture of the processor. More...
 
static CpuMicroarchitecture getCpuMicroarchitecture ()
 Provides information about the microarchitecture of the processor. More...
 
static CpuCycleCounterState acquireCycleCounter ()
 Initializes the processor cycle counter and starts counting the processor cycles. More...
 
static long releaseCycleCounter (CpuCycleCounterState cycleCounter)
 Stops counting the processor cycles, releases the system resources associated with the cycle counter, and returns the number of cycles elapsed. More...
 
static boolean isSupported (CpuIsaFeature isaFeature)
 Checks if the specified ISA extension is supported by the processor. More...
 
static boolean isSupported (CpuSimdFeature simdFeature)
 Checks if the specified SIMD extension is supported by the processor. More...
 
static boolean isSupported (CpuSystemFeature systemFeature)
 Checks if processor or system support the specified non-ISA feature. More...
 
static Version getVersion ()
 Provides information about Yeppp! library version. More...
 

Detailed Description

Non-computational functions for checking library version, quering information about processor, and benchmarking.

Member Function Documentation

static native long getTimerTicks ( )
static

Queries the ticks count of the high-resolution system timer.

The difference in ticks between two time moments divided by timer frequency gives the number of seconds between two time moments.

Returns
The current ticks count of the high-resolution system timer. This value should be interpreted as unsigned 64-bit integer.
Exceptions
SystemExceptionIf the attempt to read the high-resolution timer failed inside the OS kernel.
static native long getTimerFrequency ( )
static

Queries the frequency (number of ticks per second) of the high-resolution system timer.

The difference in ticks between two time moments divided by timer frequency gives the number of seconds between two time moments.

Returns
The frequency of the high-resolution system timer. This value should be interpreted as unsigned 64-bit integer.
Exceptions
SystemExceptionIf the attempt to read the high-resolution timer frequency failed inside the OS kernel.
static native long getTimerAccuracy ( )
static

Detects the minimum time difference in nanoseconds which can be measured by the high-resolution system timer.

Returns
The accuracy (in nanoseconds) of the high-resolution system timer. This value should be interpreted as unsigned 64-bit integer.
Exceptions
SystemExceptionIf the attempt to measure the accuracy of high-resolution timer failed inside the OS kernel.
static CpuVendor getCpuVendor ( )
static

Returns information about the vendor of the processor.

Returns
A CpuVendor object with information about the company which designed the CPU core.
See Also
CpuVendor
static CpuArchitecture getCpuArchitecture ( )
static

Provides information about the architecture of the processor.

Returns
A CpuArchitecture instance with information about the architecture of the CPU.
See Also
CpuArchitecture
static CpuMicroarchitecture getCpuMicroarchitecture ( )
static

Provides information about the microarchitecture of the processor.

Returns
A CpuMicroarchitecture instance with information about the microarchitecture of the CPU core.
See Also
CpuMicroarchitecture
static CpuCycleCounterState acquireCycleCounter ( )
static

Initializes the processor cycle counter and starts counting the processor cycles.

Call releaseCycleCounter() to get the number of processor cycles passed.

Warning
This function may allocate system resources. To avoid resource leak, always match a successfull call to acquireCycleCounter() with a call to releaseCycleCounter().
The cycle counters are not guaranteed to be syncronized across different processors/cores in a multiprocessor/multicore system. It is recommended to bind the current thread to a particular logical processor before using this function.
Returns
An object representing the state of the processor cycle counter. Pass this object to releaseCycleCounter() to get the number of cycles passed.
Exceptions
UnsupportedHardwareExceptionIf the processor does not have cycle counter.
UnsupportedSoftwareExceptionIf the operating system does not provide access to the CPU cycle counter.
SystemExceptionIf the attempt to initialize cycle counter failed inside the OS kernel.
See Also
releaseCycleCounter()
static long releaseCycleCounter ( CpuCycleCounterState  cycleCounter)
static

Stops counting the processor cycles, releases the system resources associated with the cycle counter, and returns the number of cycles elapsed.

Parameters
[in,out]cycleCounterAn object representing the state of the cycle counter returned by acquireCycleCounter(). The cycle counter should be released only once, and this function invalidates the state object.
Returns
The number of cycles elapsed since the call to acquireCycleCounter(). This value should be interpreted as unsigned 64-bit integer.
Exceptions
IllegalStateExceptionThe cycleCounter object is not a valid state of the cycle counter. This can happen if the cycleCounter object was released previously.
UnsupportedHardwareExceptionIf the processor does not have cycle counter.
UnsupportedSoftwareExceptionIf the operating system does not provide access to the CPU cycle counter.
SystemExceptionIf the attempt to read the cycle counter or release the OS resources failed inside the OS kernel.
See Also
acquireCycleCounter()
static boolean isSupported ( CpuIsaFeature  isaFeature)
static

Checks if the specified ISA extension is supported by the processor.

Parameters
[in]isaFeatureAn object specifying the ISA extension of interest.
Return values
trueIf the processor supports the specified ISA extension.
falseIf the processor does not support the specificed ISA extension.
See Also
CpuIsaFeature, X86CpuIsaFeature, ArmCpuIsaFeature, MipsCpuIsaFeature, IA64CpuIsaFeature
static boolean isSupported ( CpuSimdFeature  simdFeature)
static

Checks if the specified SIMD extension is supported by the processor.

Parameters
[in]simdFeatureAn object specifying the SIMD extension of interest.
Return values
trueIf the processor supports the specified SIMD extension.
falseIf the processor does not support the specificed SIMD extension.
See Also
CpuSimdFeature, X86CpuSimdFeature, ArmCpuSimdFeature, MipsCpuSimdFeature
static boolean isSupported ( CpuSystemFeature  systemFeature)
static

Checks if processor or system support the specified non-ISA feature.

Parameters
[in]systemFeatureAn object specifying the non-ISA processor or system feature of interest.
Return values
trueIf the specified processor or system extension is supported on this machine.
falseIf the specified processor or system extension is not supported on this machine.
See Also
CpuSystemFeature, X86CpuSystemFeature, ArmCpuSystemFeature
static Version getVersion ( )
static

Provides information about Yeppp! library version.

Returns
An object describing Yeppp! library version.
See Also
Version