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 size_t SimdCpuInfo (SimdCpuInfoType type)
 Gets info 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 properties. 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).

◆ SimdCpuInfo()

size_t SimdCpuInfo ( SimdCpuInfoType  type)

Gets info 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 << "SSE2: " << (SimdCpuInfo(SimdCpuInfoSse2) ? "Yes" : "No") << std::endl;
    std::cout << "SSE4.1: " << (SimdCpuInfo(SimdCpuInfoSse41) ? "Yes" : "No") << std::endl;
    std::cout << "AVX: " << (SimdCpuInfo(SimdCpuInfoAvx) ? "Yes" : "No") << std::endl;
    std::cout << "AVX2: " << (SimdCpuInfo(SimdCpuInfoAvx2) ? "Yes" : "No") << std::endl;
    std::cout << "AVX-512F: " << (SimdCpuInfo(SimdCpuInfoAvx512f) ? "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 << "PowerPC-Altivec: " << (SimdCpuInfo(SimdCpuInfoVmx) ? "Yes" : "No") << std::endl;
    std::cout << "PowerPC-VSX: " << (SimdCpuInfo(SimdCpuInfoVsx) ? "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 properties.

Parameters
[in,out]os- output stream.