Yeppp!
 All Classes Namespaces Functions Variables Properties 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 void Release ()
 Deinitializes Yeppp! library and releases all associated resources. More...
 
static Version GetVersion ()
 Provides information about Yeppp! library version. More...
 
static bool IsSupported (CpuIsaFeature isaFeature)
 Checks if the specified ISA extension is supported by the processor. More...
 
static bool IsSupported (CpuSimdFeature simdFeature)
 Checks if the specified SIMD extension is supported by the processor. More...
 
static bool IsSupported (CpuSystemFeature systemFeature)
 Checks if the specified non-ISA CPU or system extension is supported by the processor. More...
 
static CpuVendor GetCpuVendor ()
 Provides 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 ulong 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 ulong GetTimerTicks ()
 Queries the ticks count of the high-resolution system timer. More...
 
static ulong GetTimerFrequency ()
 Queries the frequency (number of ticks per second) of the high-resolution system timer. More...
 
static ulong GetTimerAccuracy ()
 Detects the minimum time difference in nanoseconds which can be measured by the high-resolution system timer. More...
 

Detailed Description

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

Member Function Documentation

static void Release ( )
inlinestatic

Deinitializes Yeppp! library and releases all associated resources.

This function is inteded for .Net libraries which might be unloaded (e.g. plugins) and should be called immediately before the module is unloaded.

Calling Yeppp! functions after after a call to this method is prohibited and might crash the application.

Exceptions
System.SystemExceptionResources allocated by Yeppp! library could not be unloaded due to memory corruption.
System.InvalidOperationExceptionYeppp! library is already released by this module.
static Version GetVersion ( )
inlinestatic

Provides information about Yeppp! library version.

Returns
An object describing Yeppp! library version.
See Also
Version
static bool IsSupported ( CpuIsaFeature  isaFeature)
inlinestatic

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

Parameters
isaFeatureAn object specifying the ISA extension of interest.
Returns
true if processor supports the specified ISA extension and false otherwise.
See Also
CpuIsaFeature, X86CpuIsaFeature, ArmCpuIsaFeature, MipsCpuIsaFeature, IA64CpuIsaFeature
static bool IsSupported ( CpuSimdFeature  simdFeature)
inlinestatic

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

Parameters
simdFeatureAn object specifying the SIMD extension of interest.
Returns
true if processor supports the specified SIMD extension and false otherwise.
See Also
CpuSimdFeature, X86CpuSimdFeature, ArmCpuSimdFeature, MipsCpuSimdFeature
static bool IsSupported ( CpuSystemFeature  systemFeature)
inlinestatic

Checks if the specified non-ISA CPU or system extension is supported by the processor.

Parameters
systemFeatureAn object specifying the non-ISA CPU or system extension of interest.
Returns
true if processor supports the specified non-ISA CPU or system extension and false otherwise.
See Also
CpuSimdFeature, X86CpuSystemFeature, ArmCpuSystemFeature
static CpuVendor GetCpuVendor ( )
inlinestatic

Provides 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 ( )
inlinestatic

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 ( )
inlinestatic

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 ( )
inlinestatic

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

Call ReleaseCycleCounter to get the number of processor cycles passed.

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
System.PlatformNotSupportedExceptionThe processor does not have a cycle counter or the operating system does not provide access to the CPU cycle counter
System.SystemExceptionIf the attempt to read the cycle counter or release the OS resources failed inside the OS kernel.
See Also
ReleaseCycleCounter
static ulong ReleaseCycleCounter ( CpuCycleCounterState  cycleCounter)
inlinestatic

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

Parameters
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().
Exceptions
System.InvalidOperationExceptionThe cycleCounter object is not a valid state of the cycle counter. This can happen if the cycleCounter object was released previously.
System.PlatformNotSupportedExceptionThe processor does not have a cycle counter or the operating system does not provide access to the CPU cycle counter
System.SystemExceptionIf the attempt to read the cycle counter or release the OS resources failed inside the OS kernel.
See Also
AcquireCycleCounter()
static ulong GetTimerTicks ( )
inlinestatic

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.
Exceptions
System.SystemExceptionThe attempt to read the high-resolution timer failed inside the OS kernel.
static ulong GetTimerFrequency ( )
inlinestatic

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.
Exceptions
System.SystemExceptionThe attempt to read the high-resolution timer frequency failed inside the OS kernel.
static ulong GetTimerAccuracy ( )
inlinestatic

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.
Exceptions
System.SystemExceptionIf the attempt to measure the accuracy of high-resolution timer failed inside the OS kernel.