C# Class Yeppp.Library

Non-computational functions for checking library version, quering information about processor, and benchmarking.
Exibir arquivo Open project: wdv4758h/Yeppp

Public Methods

Method Description
AcquireCycleCounter ( ) : CpuCycleCounterState

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.

GetCpuArchitecture ( ) : CpuArchitecture

Provides information about the architecture of the processor.

GetCpuMicroarchitecture ( ) : CpuMicroarchitecture

Provides information about the microarchitecture of the processor.

GetCpuVendor ( ) : Yeppp.CpuVendor

Provides information about the vendor of the processor.

GetProcessABI ( ) : ABI

Provides information about the ABI of the running process.

GetTimerAccuracy ( ) : ulong

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

GetTimerFrequency ( ) : ulong

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.

GetTimerTicks ( ) : ulong

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.

GetVersion ( ) : Version

Provides information about Yeppp! library version.

IsSupported ( CpuIsaFeature isaFeature ) : bool

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

IsSupported ( CpuSimdFeature simdFeature ) : bool

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

IsSupported ( CpuSystemFeature systemFeature ) : bool

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

Release ( ) : void

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.

ReleaseCycleCounter ( CpuCycleCounterState cycleCounter ) : ulong

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

Private Methods

Method Description
Bind ( NativeLibrary nativeLibrary ) : void
GetException ( Status status ) : System.Exception
GetString ( Enumeration enumeration, uint value, StringType stringType ) : string
Init ( ) : void
IsDefined ( Enumeration enumeration, uint value ) : bool
Unbind ( ) : void
yepLibrary_GetCpuArchitecture ( uint &architecture ) : Status
yepLibrary_GetCpuCyclesAcquire ( ulong &state ) : Status
yepLibrary_GetCpuCyclesRelease ( ulong &state, ulong &cycles ) : Status
yepLibrary_GetCpuIsaFeatures ( ulong &isaFeatures ) : Status
yepLibrary_GetCpuMicroarchitecture ( uint &vendor ) : Status
yepLibrary_GetCpuSimdFeatures ( ulong &simdFeatures ) : Status
yepLibrary_GetCpuSystemFeatures ( ulong &systemFeatures ) : Status
yepLibrary_GetCpuVendor ( uint &vendor ) : Status
yepLibrary_GetString ( Enumeration enumeration, uint value, StringType stringType, System buffer, System &length ) : Status
yepLibrary_GetTimerAccuracy ( ulong &accuracy ) : Status
yepLibrary_GetTimerFrequency ( ulong &frequency ) : Status
yepLibrary_GetTimerTicks ( ulong &ticks ) : Status
yepLibrary_GetVersion ( ) : System.IntPtr
yepLibrary_Init ( ) : Status
yepLibrary_Release ( ) : Status

Method Details

AcquireCycleCounter() public static method

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.
The processor does not have a cycle counter or the operating system does not provide access to the CPU cycle counter If the attempt to read the cycle counter or release the OS resources failed inside the OS kernel.
public static AcquireCycleCounter ( ) : CpuCycleCounterState
return CpuCycleCounterState

GetCpuArchitecture() public static method

Provides information about the architecture of the processor.
public static GetCpuArchitecture ( ) : CpuArchitecture
return CpuArchitecture

GetCpuMicroarchitecture() public static method

Provides information about the microarchitecture of the processor.
public static GetCpuMicroarchitecture ( ) : CpuMicroarchitecture
return CpuMicroarchitecture

GetCpuVendor() public static method

Provides information about the vendor of the processor.
public static GetCpuVendor ( ) : Yeppp.CpuVendor
return Yeppp.CpuVendor

GetProcessABI() public static method

Provides information about the ABI of the running process.
public static GetProcessABI ( ) : ABI
return ABI

GetTimerAccuracy() public static method

Detects the minimum time difference in nanoseconds which can be measured by the high-resolution system timer.
If the attempt to measure the accuracy of high-resolution timer failed inside the OS kernel.
public static GetTimerAccuracy ( ) : ulong
return ulong

GetTimerFrequency() public static method

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.
The attempt to read the high-resolution timer frequency failed inside the OS kernel.
public static GetTimerFrequency ( ) : ulong
return ulong

GetTimerTicks() public static method

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.
The attempt to read the high-resolution timer failed inside the OS kernel.
public static GetTimerTicks ( ) : ulong
return ulong

GetVersion() public static method

Provides information about Yeppp! library version.
public static GetVersion ( ) : Version
return Version

IsSupported() public static method

Checks if the specified ISA extension is supported by the processor.
public static IsSupported ( CpuIsaFeature isaFeature ) : bool
isaFeature CpuIsaFeature An object specifying the ISA extension of interest.
return bool

IsSupported() public static method

Checks if the specified SIMD extension is supported by the processor.
public static IsSupported ( CpuSimdFeature simdFeature ) : bool
simdFeature CpuSimdFeature An object specifying the SIMD extension of interest.
return bool

IsSupported() public static method

Checks if the specified non-ISA CPU or system extension is supported by the processor.
public static IsSupported ( CpuSystemFeature systemFeature ) : bool
systemFeature CpuSystemFeature An object specifying the non-ISA CPU or system extension of interest.
return bool

Release() public static method

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.
Resources allocated by Yeppp! library could not be unloaded due to memory corruption. Yeppp! library is already released by this module.
public static Release ( ) : void
return void

ReleaseCycleCounter() public static method

Stops counting the processor cycles, releases the system resources associated with the cycle counter, and returns the number of cycles elapsed.
The cycleCounter object is not a valid state of the cycle counter. This can happen if the cycleCounter object was released previously. The processor does not have a cycle counter or the operating system does not provide access to the CPU cycle counter If the attempt to read the cycle counter or release the OS resources failed inside the OS kernel.
public static ReleaseCycleCounter ( CpuCycleCounterState cycleCounter ) : ulong
cycleCounter CpuCycleCounterState An object representing the state of the cycle counter returned by . The cycle counter should be released only once, and this function invalidates the state object.
return ulong