Simd Library Documentation.

Home | Release Notes | Download | Documentation | Issues | GitHub

Functions with information about library. More...

Functions

SIMD_API const char * SimdVersion ()
 Gets version of Simd Library. More...
 
SIMD_API const char * SimdCpuDesc (SimdCpuDescType type)
 Gets description of CPU and Simd Library. More...
 
SIMD_API uint64_t SimdCpuInfo (SimdCpuInfoType type)
 Gets information about CPU and Simd Library. More...
 
SIMD_API const char * SimdPerformanceStatistic ()
 Gets internal performance statistics of Simd Library. More...
 
SIMD_INLINE void PrintInfo (std::ostream &os)
 Prints information about Simd Library and CPU. More...
 

Detailed Description

Functions with information about library.

Function Documentation

◆ SimdVersion()

const char * SimdVersion ( )

Gets version of Simd Library.

Returns
string with version of Simd Library (major version number, minor version number, release number, number of SVN's commits).

◆ SimdCpuDesc()

const char * SimdCpuDesc ( SimdCpuDescType  type)

Gets description of CPU and Simd Library.

Note
See enumeration SimdCpuDescType.

Using example:

#include "Simd/SimdLib.h"
#include <iostream>

int main()
{
    std::cout << "CPU: " << SimdCpuDesc(SimdCpuDescModel) << std::endl;
    return 0;
}
Parameters
[in]type- a type of required description.
Returns
a value which contains description of CPU and Simd Library.

◆ SimdCpuInfo()

uint64_t SimdCpuInfo ( SimdCpuInfoType  type)

Gets information about CPU and Simd Library.

Note
See enumeration SimdCpuInfoType.

Using example:

#include "Simd/SimdLib.h"
#include <iostream>

int main()
{
    std::cout << "Sockets: " << SimdCpuInfo(SimdCpuInfoSockets) << std::endl;
    std::cout << "Cores: " << SimdCpuInfo(SimdCpuInfoCores) << std::endl;
    std::cout << "Threads: " << SimdCpuInfo(SimdCpuInfoThreads) << std::endl;
    std::cout << "L1D Cache: " << SimdCpuInfo(SimdCpuInfoCacheL1) / 1024  << " KB" << std::endl;
    std::cout << "L2 Cache: " << SimdCpuInfo(SimdCpuInfoCacheL2) / 1024  << " KB" << std::endl;
    std::cout << "L3 Cache: " << SimdCpuInfo(SimdCpuInfoCacheL3) / 1024  << " KB" << std::endl;
    std::cout << "RAM: " << SimdCpuInfo(SimdCpuInfoRam) / 1024 / 1024 << " MB" << std::endl;
    std::cout << "SSE4.1: " << (SimdCpuInfo(SimdCpuInfoSse41) ? "Yes" : "No") << std::endl;
    std::cout << "AVX2: " << (SimdCpuInfo(SimdCpuInfoAvx2) ? "Yes" : "No") << std::endl;
    std::cout << "AVX-512BW: " << (SimdCpuInfo(SimdCpuInfoAvx512bw) ? "Yes" : "No") << std::endl;
    std::cout << "AVX-512VNNI: " << (SimdCpuInfo(SimdCpuInfoAvx512vnni) ? "Yes" : "No") << std::endl;
    std::cout << "AMX-BF16: " << (SimdCpuInfo(SimdCpuInfoAmxBf16) ? "Yes" : "No") << std::endl;
    std::cout << "ARM-NEON: " << (SimdCpuInfo(SimdCpuInfoNeon) ? "Yes" : "No") << std::endl;
    return 0;
}
Parameters
[in]type- a type of required information.
Returns
a value which contains information about CPU and Simd Library.

◆ SimdPerformanceStatistic()

const char * SimdPerformanceStatistic ( )

Gets internal performance statistics of Simd Library.

Note
Simd Library have to be build with defined SIMD_PERFORMANCE_STATISTIC macro.
Returns
string with internal performance statistics of Simd Library.

◆ PrintInfo()

void PrintInfo ( std::ostream &  os)

Prints information about Simd Library and CPU.

Parameters
[in,out]os- output stream.