Implement runtime check for AVX2 SIMD functionality in collisions #203
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.
This PR implements a runtime check on whether the AVX2 instruction set is present or not in the CPU. Compile-time macros like
__AVX2__
only flags whether the compiler support generating code using AVX2, but not whether the running system would be able to execute it. If a non-AVX2-supporting processor runs an AVX2-using code, the program will generate a segfault over an unrecognized instruction/opcode, as what I intend to fix #202. Because pygame-geometry doesn't use SDL2, which means not being able to use the straightforwardSDL_HasAVX2
function, I had to make my own function to check it.