{"id":13418599,"url":"https://github.com/ermig1979/Simd","last_synced_at":"2025-03-15T03:31:38.249Z","repository":{"id":29339269,"uuid":"32873163","full_name":"ermig1979/Simd","owner":"ermig1979","description":"C++ image processing and machine learning library with using of SIMD: SSE, AVX, AVX-512, AMX  for x86/x64, NEON for ARM.","archived":false,"fork":false,"pushed_at":"2024-10-22T14:48:37.000Z","size":41312,"stargazers_count":2059,"open_issues_count":26,"forks_count":412,"subscribers_count":115,"default_branch":"master","last_synced_at":"2024-10-29T15:38:50.811Z","etag":null,"topics":["amx","arm","avx","avx512","c-plus-plus","haar-cascade","image-processing","lbp","machine-learning","neon","neural-network","simd","simd-library","sse"],"latest_commit_sha":null,"homepage":"http://ermig1979.github.io/Simd","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ermig1979.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-03-25T15:24:55.000Z","updated_at":"2024-10-29T09:02:53.000Z","dependencies_parsed_at":"2023-10-17T00:00:39.836Z","dependency_job_id":"2b0b7b58-a6a6-40b6-93dc-bdf3a4363906","html_url":"https://github.com/ermig1979/Simd","commit_stats":null,"previous_names":[],"tags_count":77,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ermig1979%2FSimd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ermig1979%2FSimd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ermig1979%2FSimd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ermig1979%2FSimd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ermig1979","download_url":"https://codeload.github.com/ermig1979/Simd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243681024,"owners_count":20330152,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amx","arm","avx","avx512","c-plus-plus","haar-cascade","image-processing","lbp","machine-learning","neon","neural-network","simd","simd-library","sse"],"created_at":"2024-07-30T22:01:04.314Z","updated_at":"2025-03-15T03:31:33.239Z","avatar_url":"https://github.com/ermig1979.png","language":"C++","readme":"Introduction\n============\n\nThe [Simd Library](http://ermig1979.github.io/Simd) is a free open source image processing and machine learning library, designed for C and C++ programmers. \nIt provides many useful high performance algorithms for image processing such as: \npixel format conversion, image scaling and filtration, extraction of statistic information from images, motion detection,\nobject detection and classification, neural network.\n\nThe algorithms are optimized with using of different SIMD CPU extensions. \nIn particular the library supports following CPU extensions: \nSSE, AVX, AVX-512 and AMX for x86/x64, NEON for ARM.\n\nThe Simd Library has C API and also contains useful C++ classes and functions to facilitate access to C API. \nThe library supports dynamic and static linking, 32-bit and 64-bit Windows and Linux, \nMSVS, G++ and Clang compilers, MSVS project and CMake build systems.\n\nLibrary folder's structure\n==========================\n\nThe Simd Library has next folder's structure:\n\n* `simd/src/Simd/` - contains source codes of the library.\n* `simd/src/Test/` - contains test framework of the library.\n* `simd/src/Use/` - contains the use examples of the library.\n* `simd/py/SimdPy/` - contains Python wrapper of the library.\n* `simd/prj/vs2015/` - contains project files of Microsoft Visual Studio 2015.\n* `simd/prj/vs2017/` - contains project files of Microsoft Visual Studio 2017.\n* `simd/prj/vs2019/` - contains project files of Microsoft Visual Studio 2019.\n* `simd/prj/vs2022/` - contains project files of Microsoft Visual Studio 2022.\n* `simd/prj/cmd/` - contains additional scripts needed for building of the library in Windows.\n* `simd/prj/cmake/` - contains files of CMake build systems.\n* `simd/prj/sh/` - contains additional scripts needed for building of the library in Linux.\n* `simd/prj/txt/` - contains text files needed for building of the library.\n* `simd/data/cascade/` - contains OpenCV cascades (HAAR and LBP).\n* `simd/data/image/` - contains image samples.\n* `simd/data/network/` - contains examples of trained networks.\n* `simd/docs/` - contains documentation of the library.\n\nBuilding the library for Windows\n================================\n\nTo build the library and test application for Windows 32/64 you need to use Microsoft Visual Studio 2022 (or 2015/2017/2019). \nThe project files are in the directory: \n\n`simd/prj/vs2022/`\n\nBy default the library is built as a DLL (Dynamic Linked Library).\nYou also may build it as a static library. \nTo do this you must change appropriate property (Configuration Type) of **Simd** project and also uncomment `#define SIMD_STATIC` in file:\n\n`simd/src/Simd/SimdConfig.h`\n\nAlso in order to build the library you can use CMake and MinGW:\n\n\tmkdir build\n\tcd build\n\tcmake ..\\prj\\cmake -DSIMD_TOOLCHAIN=\"your_toolchain\\bin\\g++\" -DSIMD_TARGET=\"x86_64\" -DCMAKE_BUILD_TYPE=\"Release\" -G \"MinGW Makefiles\"\n\tmingw32-make\n\nBuilding the library for Linux\n==============================\n\nTo build the library and test application for Linux 32/64 you need to use CMake build systems.\nFiles of CMake build systems are placed in the directory:\n\n`simd/prj/cmake/`\n\t\nThe library can be built for x86/x64, ARM(32/64) platforms using the G++ or Clang compilers.\nUsing the native compiler (g++) for the current platform is simple:\n\n\tmkdir build\n\tcd build\n\tcmake ../prj/cmake -DSIMD_TOOLCHAIN=\"\" -DSIMD_TARGET=\"\"\n\tmake\n\t\nTo build the library for ARM(32/64) platform you can also use a toolchain for cross compilation.\nThere is an example of using for ARM (32 bit):\n\n\tmkdir build\n\tcd build\n\tcmake ../prj/cmake -DSIMD_TOOLCHAIN=\"/your_toolchain/usr/bin/arm-linux-gnueabihf-g++\" -DSIMD_TARGET=\"arm\" -DCMAKE_BUILD_TYPE=\"Release\"\n\tmake\n\nAnd for ARM (64 bit):\n\n\tmkdir build\n\tcd build\n\tcmake ../prj/cmake -DSIMD_TOOLCHAIN=\"/your_toolchain/usr/bin/aarch64-linux-gnu-g++\" -DSIMD_TARGET=\"aarch64\" -DCMAKE_BUILD_TYPE=\"Release\"\n\tmake\n\nAs result the library and the test application will be built in the current directory.\n\nThere are addition build parameters:\n\n* `SIMD_AVX512` - Enable of AVX-512 (AVX-512F, AVX-512CD, AVX-512VL, AVX-512DQ, AVX-512BW) CPU extensions. It is switched on by default.\n* `SIMD_AVX512VNNI` - Enable of AVX-512-VNNI CPU extensions. It is switched on by default.\n* `SIMD_AMXBF16` - Enable of AMX-BF16, AMX-INT8 and AVX-512-BF16 CPU extensions. It is switched off by default.\n* `SIMD_TEST` - Build test framework. It is switched on by default.\n* `SIMD_INFO` - Print build information. It is switched on by default.\n* `SIMD_PERF` - Enable of internal performance statistic. It is switched off by default.\n* `SIMD_SHARED` - Build as SHARED library. It is switched off by default.\n* `SIMD_GET_VERSION` - Call scipt to get Simd Library version. It is switched on by default.\n* `SIMD_SYNET` - Enable optimizations for Synet framework. It is switched on by default.\n* `SIMD_INT8_DEBUG` - Enable debug INT8 capabilities for Synet framework. It is switched off by default.\n* `SIMD_HIDE` - Hide internal functions of Simd Library. It is switched off by default.\n* `SIMD_RUNTIME` - Enable of runtime faster algorithm choise. It is switched on by default.\n* `SIMD_TEST_FLAGS` - Addition compiler flags to build test framework.\n* `SIMD_OPENCV` - Use OpenCV in test framework. It is switched off by default.\n* `SIMD_INSTALL` - Enabling of install target. It is switched on by default.\n* `SIMD_UNINSTALL` - Enabling of uninstall target. It is switched on by default.\n* `SIMD_PYTHON` - Enabling of Simd Python wrapper. It is switched on by default.\n\nUsing the library\n=================\n\nIf you use the library from C code you must include:\n\t\n    #include \"Simd/SimdLib.h\"\n\nAnd to use the library from C++ code you must include:\n\n    #include \"Simd/SimdLib.hpp\"\n\nIn order to use [Simd::Detection](http://ermig1979.github.io/Simd/help/struct_simd_1_1_detection.html) you must include:\n\n    #include \"Simd/SimdDetection.hpp\"\n\t\nIn order to use [Simd::Neural](http://ermig1979.github.io/Simd/help/namespace_simd_1_1_neural.html) you must include:\n\n    #include \"Simd/SimdNeural.hpp\"\n\t\nIn order to use [Simd::Motion](http://ermig1979.github.io/Simd/help/namespace_simd_1_1_motion.html) you must include:\n\n    #include \"Simd/SimdMotion.hpp\"\n\nPackage Managers\n================\n\nYou can download and install simd using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager:\n\n    git clone https://github.com/Microsoft/vcpkg.git\n    cd vcpkg\n    ./bootstrap-vcpkg.sh\n    ./vcpkg integrate install\n    ./vcpkg install simd\n\nThe simd port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.\n\nInteraction with OpenCV\n=======================\n\nIf you need to use mutual conversion between Simd and OpenCV types you just have to define macro `SIMD_OPENCV_ENABLE` before including of Simd headers:\n    \n    #include \u003copencv2/core/core.hpp\u003e\n    #define SIMD_OPENCV_ENABLE\n    #include \"Simd/SimdLib.hpp\"\n\nAnd you can convert next types:\n\t\n* `cv::Point`, `cv::Size` \u003c--\u003e `Simd::Point`.\n* `cv::Rect` \u003c--\u003e `Simd::Rectangle`.\n* `cv::Mat` \u003c--\u003e `Simd::View`.\n\t\nTest Framework\n==============\n\nThe test suite is needed for testing of correctness of work of the library and also for its performance testing.\nThere is a set of tests for every function from API of the library. \nThere is an example of test application using:\n\n\t./Test -m=a -tt=1 -f=Sobel -ot=log.txt\n\nWhere next parameters were used:\n\n* `-m=a` - a auto checking mode which includes performance testing (only for library built in Release mode). \nIn this case different implementations of each functions will be compared between themselves \n(for example a scalar implementation and implementations with using of different SIMD instructions such as SSE2, AVX2, and other).\nAlso it can be `-m=s` (running of special tests).\n* `-tt=1` - a number of test threads. Use -1 to set maximum parallelization.\n* `-fi=Sobel` - an include filter. In current case will be tested only functions which contain word 'Sobel' in their names. \nIf you miss this parameter then full testing will be performed.\nYou can use several filters - function name has to satisfy at least one of them.\n* `-ot=log.txt` - a file name with test report (in TEXT file format). The test's report also will be output to console.\n    \nAlso you can use parameters:\n\n* `-help` or `-?` in order to print help message.\n* `-r=../..` to set project root directory.\n* `-pa=1` to print alignment statistics.\n* `-pi=1` to print internal statistics (Cmake parameter SIMD_PERF must be ON).\n* `-c=512` a number of channels in test image for performance testing.\n* `-h=1080` a height of test image for performance testing.\n* `-w=1920` a width of test image for performance testing.\n* `-oh=log.html` - a file name with test report (in HTML file format).\t\n* `-s=sample.avi` a video source (See `Simd::Motion` test).\n* `-o=output.avi` an annotated video output (See `Simd::Motion` test).\n* `-wt=1` a thread number used to parallelize algorithms. Use -1 to set maximum parallelization.\n* `-fe=Abs` an exclude filter to exclude some tests.\n* `-mt=100` a minimal test execution time (in milliseconds).\n* `-lc=1` to litter CPU cache between test runs.\n* `-ri=city.jpg` a name of real image used in some tests. The image have to be placed in `./data/image` directory.\n* `-tr=2` a number of test execution repeats.\n* `-ts=1` to print statistics of time of tests execution.\n* `-cc=1` to check c++ API.\n* `-de=2` a flags of SIMD extensions which testing are disabled. Base - 1, 2 - SSE4.1/NEON, 4 - AVX2, 8 - AVX-512BW, 16 - AVX-512VNNI, 32 - AMX-BF16.\n* `-wu=100` a time to warm up CPU before testing (in milliseconds).\n\n","funding_links":[],"categories":["TODO scan for Android support in followings","Image Processing","Sensor Processing","C++","Maths","Image processing","其他_机器学习与深度学习"],"sub_categories":["Image Processing","fake data"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fermig1979%2FSimd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fermig1979%2FSimd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fermig1979%2FSimd/lists"}