Simd Library Documentation.

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

Functions with information about library. More...

Functions

SIMD_API const char * SimdVersion ()
 Gets version of Simd Library. More...
 
SIMD_API int SimdCpuInfo ()
 Gets info about SIMD extensions supported by CPU and Simd Library. 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()

int SimdCpuInfo ( )

Gets info about SIMD extensions supported by CPU and Simd Library.

Note
See enumeration SimdCpuInfoFlags.

Using example:

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

int main()
{
    int info = SimdCpuInfo();
    std::cout << "SSE: " << (info&(1 << SimdCpuInfoSse) ? "Yes" : "No") << std::endl;
    std::cout << "SSE2: " << (info&(1 << SimdCpuInfoSse2) ? "Yes" : "No") << std::endl;
    std::cout << "SSE3: " << (info&(1 << SimdCpuInfoSse3) ? "Yes" : "No") << std::endl;
    std::cout << "SSSE3: " << (info&(1 << SimdCpuInfoSsse3) ? "Yes" : "No") << std::endl;
    std::cout << "SSE4.1: " << (info&(1 << SimdCpuInfoSse41) ? "Yes" : "No") << std::endl;
    std::cout << "SSE4.2: " << (info&(1 << SimdCpuInfoSse42) ? "Yes" : "No") << std::endl;
    std::cout << "AVX: " << (info&(1 << SimdCpuInfoAvx) ? "Yes" : "No") << std::endl;
    std::cout << "AVX2: " << (info&(1 << SimdCpuInfoAvx2) ? "Yes" : "No") << std::endl;
    std::cout << "AVX-512F: " << (info&(1 << SimdCpuInfoAvx512f) ? "Yes" : "No") << std::endl;
    std::cout << "AVX-512BW: " << (info&(1 << SimdCpuInfoAvx512bw) ? "Yes" : "No") << std::endl;
    std::cout << "PowerPC-Altivec: " << (info&(1 << SimdCpuInfoVmx) ? "Yes" : "No") << std::endl;
    std::cout << "PowerPC-VSX: " << (info&(1 << SimdCpuInfoVsx) ? "Yes" : "No") << std::endl;
    std::cout << "ARM-NEON: " << (info&(1 << SimdCpuInfoNeon) ? "Yes" : "No") << std::endl;
    std::cout << "MIPS-MSA: " << (info&(1 << SimdCpuInfoMsa) ? "Yes" : "No") << std::endl;
    return 0;
}
Returns
an integer value which bits contains information about SIMD extensions supported by CPU and Simd Library.