Allow gcc to vectorize gather_smallbuf() in openmp_kernels #151
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.
These are trivial tweaks that only change omp
gather_smallbuf()
for gcc, because that's all I've tested. I am currently making use of them by passing in some compile-time flags via CMAKE_C_FLAGS at build time. For example, on a Sapphire-Rapids node, even with-march=native
, gcc only uses AVX2 instructions. To get it to use AVX512 vector instructions, you apparently need-fprefer-vector-width=512
, and gcc >= 11. I have some scripting to figure out the gcc options from our side, but integrating automated options directly into your CMakeLists.txt would require a-little-more-comprehensive testing across compilers and hosts. The larger vectors do show some additional speedup (beyond AVX2) in a weak-scaling test.