Add SVE2 BackgroundIncrementCount optimization#369
Merged
Conversation
Co-authored-by: Ihar Yermalayeu <ermig@tut.by>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds an ARM SVE2-optimized implementation of BackgroundIncrementCount and wires it into the library’s runtime dispatch, along with corresponding test and VS2022 project updates.
Changes:
- Implement
Simd::Sve2::BackgroundIncrementCountusing predicated SVE2 byte ops with tail handling. - Route
SimdBackgroundIncrementCountto the SVE2 path whenSve2::Enableis true. - Extend background auto-tests and add the new SVE2 source file to the VS2022 SVE2 project.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/Test/TestBackground.cpp | Adds an auto-test path for the SVE2 BackgroundIncrementCount implementation. |
| src/Simd/SimdSve2Background.cpp | Introduces the SVE2 implementation of BackgroundIncrementCount with predication and tail masking. |
| src/Simd/SimdSve2.h | Declares the new SVE2 BackgroundIncrementCount API. |
| src/Simd/SimdLib.cpp | Updates dispatch to call the SVE2 implementation when available. |
| prj/vs2022/Sve2.vcxproj.filters | Adds a new filter entry and places the new source file under it. |
| prj/vs2022/Sve2.vcxproj | Includes the new SVE2 source file in the VS2022 project. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Simd::Sve2::BackgroundIncrementCountwith predicated SVE2 byte operations.SimdBackgroundIncrementCountto the SVE2 implementation when available.Testing
cmake ./prj/cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++ -DCMAKE_C_COMPILER=gcc -DSIMD_TOOLCHAIN="g++" -DSIMD_TARGET="" -DSIMD_AVX512VNNI=ON -DSIMD_AMXBF16=ON -DSIMD_TEST_FLAGS="-march=native" -DSIMD_SHARED=ONcmake --build build --parallel$(nproc)export LD_LIBRARY_PATH="/workspace/build:$LD_LIBRARY_PATH" && ./Test "-r=.." -fi=BackgroundIncrementCount -tt=1 -ts=1aarch64-linux-gnu-g++ -std=c++17 -I"/workspace/src" -march=armv9-a+sve2 -msve-vector-bits=scalable -fsyntax-only "/workspace/src/Simd/SimdSve2Background.cpp"aarch64-linux-gnu-g++ -std=c++17 -I"/workspace/src" -march=armv9-a+sve2 -msve-vector-bits=scalable -fsyntax-only "/workspace/src/Simd/SimdLib.cpp"aarch64-linux-gnu-g++ -std=c++17 -I"/workspace/src" -march=armv9-a+sve2 -msve-vector-bits=scalable -c "/workspace/src/Simd/SimdSve2Background.cpp" -o "/tmp/SimdSve2Background.o"