All Projects → ermig1979 → Simd

ermig1979 / Simd

Licence: mit
C++ image processing and machine learning library with using of SIMD: SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2, AVX-512, VMX(Altivec) and VSX(Power7), NEON for ARM.

Projects that are alternatives of or similar to Simd

Simde
Implementations of SIMD instruction sets for systems which don't natively support them.
Stars: ✭ 1,012 (-19.87%)
Mutual labels:  arm, simd, sse, powerpc, neon, avx2, avx512, avx
Unisimd Assembler
SIMD macro assembler unified for ARM, MIPS, PPC and x86
Stars: ✭ 63 (-95.01%)
Mutual labels:  simd, sse, powerpc, neon, avx2, avx512, avx
Sleef
SIMD Library for Evaluating Elementary Functions, vectorized libm and DFT
Stars: ✭ 353 (-72.05%)
Mutual labels:  arm, simd, powerpc, neon, avx512, avx
Quadray Engine
Realtime raytracer using SIMD on ARM, MIPS, PPC and x86
Stars: ✭ 13 (-98.97%)
Mutual labels:  simd, sse, neon, avx2, avx512, avx
Boost.simd
Boost SIMD
Stars: ✭ 238 (-81.16%)
Mutual labels:  simd, sse, neon, avx2, avx512, avx
Vc
SIMD Vector Classes for C++
Stars: ✭ 985 (-22.01%)
Mutual labels:  simd, sse, neon, avx2, avx512, avx
Libsimdpp
Portable header-only C++ low level SIMD library
Stars: ✭ 914 (-27.63%)
Mutual labels:  simd, sse, neon, avx2, avx512
Directxmath
DirectXMath is an all inline SIMD C++ linear algebra library for use in games and graphics apps
Stars: ✭ 859 (-31.99%)
Mutual labels:  simd, sse, neon, avx2, avx
Xsimd
C++ wrappers for SIMD intrinsics and parallelized, optimized mathematical functions (SSE, AVX, NEON, AVX512)
Stars: ✭ 964 (-23.67%)
Mutual labels:  simd, sse, neon, avx512, avx
Libxsmm
Library for specialized dense and sparse matrix operations, and deep learning primitives.
Stars: ✭ 518 (-58.99%)
Mutual labels:  simd, sse, avx2, avx512, avx
Base64simd
Base64 coding and decoding with SIMD instructions (SSE/AVX2/AVX512F/AVX512BW/AVX512VBMI/ARM Neon)
Stars: ✭ 115 (-90.89%)
Mutual labels:  simd, sse, neon, avx2, avx512
Std Simd
std::experimental::simd for GCC [ISO/IEC TS 19570:2018]
Stars: ✭ 275 (-78.23%)
Mutual labels:  simd, sse, neon, avx512, avx
cpuwhat
Nim utilities for advanced CPU operations: CPU identification, ISA extension detection, bindings to assorted intrinsics
Stars: ✭ 25 (-98.02%)
Mutual labels:  arm, avx, sse, simd, avx2
Nsimd
Agenium Scale vectorization library for CPUs and GPUs
Stars: ✭ 138 (-89.07%)
Mutual labels:  simd, neon, avx2, avx512, avx
ternary-logic
Support for ternary logic in SSE, XOP, AVX2 and x86 programs
Stars: ✭ 21 (-98.34%)
Mutual labels:  avx, sse, simd, avx2, avx512
Umesimd
UME::SIMD A library for explicit simd vectorization.
Stars: ✭ 66 (-94.77%)
Mutual labels:  simd, neon, avx2, avx512, avx
Cglm
📽 Highly Optimized Graphics Math (glm) for C
Stars: ✭ 887 (-29.77%)
Mutual labels:  simd, sse, neon, avx
simd-byte-lookup
SIMDized check which bytes are in a set
Stars: ✭ 23 (-98.18%)
Mutual labels:  sse, simd, avx2, avx512
oversimple
A library for audio oversampling, which tries to offer a simple api while wrapping HIIR, by Laurent De Soras, for minimum phase antialiasing, and r8brain-free-src, by Aleksey Vaneev, for linear phase antialiasing.
Stars: ✭ 25 (-98.02%)
Mutual labels:  neon, avx, sse, simd
utf8
Fast UTF-8 validation with range algorithm (NEON+SSE4+AVX2)
Stars: ✭ 60 (-95.25%)
Mutual labels:  arm, neon, simd, avx2

Introduction

The Simd Library is a free open source image processing and machine learning library, designed for C and C++ programmers. It provides many useful high performance algorithms for image processing such as: pixel format conversion, image scaling and filtration, extraction of statistic information from images, motion detection, object detection (HAAR and LBP classifier cascades) and classification, neural network.

The algorithms are optimized with using of different SIMD CPU extensions. In particular the library supports following CPU extensions: SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AVX, AVX2 and AVX-512 for x86/x64, VMX(Altivec) and VSX(Power7) for PowerPC (big-endian), NEON for ARM.

The Simd Library has C API and also contains useful C++ classes and functions to facilitate access to C API. The library supports dynamic and static linking, 32-bit and 64-bit Windows, Android and Linux, MSVS, G++ and Clang compilers, MSVS project and CMake build systems.

Library folder's structure

The Simd Library has next folder's structure:

  • simd/src/Simd/ - contains source codes of the library.
  • simd/src/Test/ - contains test framework of the library.
  • simd/src/Use/ - contains the use examples of the library.
  • simd/prj/vs2015/ - contains project files of Microsoft Visual Studio 2015.
  • simd/prj/vs2017w/ - contains project files of Microsoft Visual Studio 2017 (for Windows).
  • simd/prj/vs2017a/ - contains project files of Microsoft Visual Studio 2017 (for Android).
  • simd/prj/vs2019/ - contains project files of Microsoft Visual Studio 2019.
  • simd/prj/cmd/ - contains additional scripts needed for building of the library in Windows.
  • simd/prj/cmake/ - contains files of CMake build systems.
  • simd/prj/sh/ - contains additional scripts needed for building of the library in Linux.
  • simd/prj/txt/ - contains text files needed for building of the library.
  • simd/data/cascade/ - contains OpenCV cascades (HAAR and LBP).
  • simd/data/image/ - contains image samples.
  • simd/data/network/ - contains examples of trained networks.
  • simd/docs/ - contains documentation of the library.

The library building for Windows

To build the library and test application for Windows 32/64 you need to use Microsoft Visual Studio 2019 (or 2015/2017). The project files are in the directory:

simd/prj/vs2019/

By default the library is built as a DLL (Dynamic Linked Library). You also may build it as a static library. To do this you must change appropriate property (Configuration Type) of Simd project and also uncomment #define SIMD_STATIC in file:

simd/src/Simd/SimdConfig.h

Also in order to build the library you can use CMake and MinGW:

cd .\prj\cmake
cmake . -DSIMD_TOOLCHAIN="your_toolchain\bin\g++" -DSIMD_TARGET="x86_64" -DCMAKE_BUILD_TYPE="Release" -G "MinGW Makefiles"
mingw32-make

The library building for Android

To build the library and test application for Android(x86, x64, ARM, ARM64) you need to use Microsoft Visual Studio 2017. The project files are in the directory:

simd/prj/vs2017a/

By default the library is built as a SO (Dynamic Library).

The library building for Linux

To build the library and test application for Linux 32/64 you need to use CMake build systems. Files of CMake build systems are placed in the directory:

simd/prj/cmake/

The library can be built for x86/x64, PowerPC(64, big-endian) and ARM(32/64) platforms with using of G++ or Clang compilers. With using of native compiler (g++) for current platform it is simple:

cd ./prj/cmake
cmake . -DSIMD_TOOLCHAIN="" -DSIMD_TARGET=""
make

To build the library for PowerPC(64, big-endian) and ARM(32/64) platforms you can also use toolchain for cross compilation. There is an example of using for PowerPC (64 bit, big-endian):

cd ./prj/cmake
cmake . -DSIMD_TOOLCHAIN="/your_toolchain/usr/bin/powerpc-linux-gnu-g++" -DSIMD_TARGET="ppc64" -DCMAKE_BUILD_TYPE="Release"
make

For ARM (32 bit):

cd ./prj/cmake
cmake . -DSIMD_TOOLCHAIN="/your_toolchain/usr/bin/arm-linux-gnueabihf-g++" -DSIMD_TARGET="arm" -DCMAKE_BUILD_TYPE="Release"
make

And for ARM (64 bit):

cd ./prj/cmake
cmake . -DSIMD_TOOLCHAIN="/your_toolchain/usr/bin/aarch64-linux-gnu-g++" -DSIMD_TARGET="aarch64" -DCMAKE_BUILD_TYPE="Release"
make

As result the library and the test application will be built in the current directory.

The library using

If you use the library from C code you must include:

#include "Simd/SimdLib.h"

And to use the library from C++ code you must include:

#include "Simd/SimdLib.hpp"

In order to use Simd::Detection you must include:

#include "Simd/SimdDetection.hpp"

In order to use Simd::Neural you must include:

#include "Simd/SimdNeural.hpp"

In order to use Simd::Motion you must include:

#include "Simd/SimdMotion.hpp"

Interaction with OpenCV

If you need use mutual conversion between Simd and OpenCV types you just have to define macro SIMD_OPENCV_ENABLE before including of Simd headers:

#include <opencv2/core/core.hpp>
#define SIMD_OPENCV_ENABLE
#include "Simd/SimdLib.hpp"

And you can convert next types:

  • cv::Point, cv::Size <--> Simd::Point.
  • cv::Rect <--> Simd::Rectangle.
  • cv::Mat <--> Simd::View.

Test Framework

The test suite is needed for testing of correctness of work of the library and also for its performance testing. There is a set of tests for every function from API of the library. There is an example of test application using:

./Test -m=a -tt=1 -f=Sobel -ot=log.txt

Where next parameters were used:

  • -m=a - a auto checking mode which includes performance testing (only for library built in Release mode). In this case different implementations of each functions will be compared between themselves (for example a scalar implementation and implementations with using of different SIMD instructions such as SSE2, AVX2, and other). Also it can be -m=c (creation of test data for cross-platform testing), -m=v (cross-platform testing with using of early prepared test data) and -m=s (running of special tests).
  • -tt=1 - a number of test threads.
  • -fi=Sobel - an include filter. In current case will be tested only functions which contain word 'Sobel' in their names. If you miss this parameter then full testing will be performed. You can use several filters - function name has to satisfy at least one of them.
  • -ot=log.txt - a file name with test report (in TEXT file format). The test's report also will be output to console.

Also you can use parameters:

  • -help or -? in order to print help message.
  • -r=../.. to set project root directory.
  • -pa=1 to print alignment statistics.
  • -c=512 a number of channels in test image for performance testing.
  • -h=1080 a height of test image for performance testing.
  • -w=1920 a width of test image for performance testing.
  • -oh=log.html - a file name with test report (in HTML file format).
  • -s=sample.avi a video source (See Simd::Motion test).
  • -o=output.avi an annotated video output (See Simd::Motion test).
  • -wt=1 a thread number used to parallelize algorithms.
  • -fe=Abs an exclude filter to exclude some tests.
  • -mt=100 a minimal test execution time (in milliseconds).
  • -lc=1 to litter CPU cache between test runs.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].