Repository navigation
AVX2 and runtime switching of SIMD implementations #171
Replies: 2 comments 3 replies
|
We should try the contact solver first. Especially since there is a Box2D example. |
|
I've added 8 wide versions of contact solver as well as collide hulls. Tests have been run and pass, I've run visual spot checks in the samples app, and tested across clang-cl as well as msvc. I don't have any *nix systems, so that still needs to be verified, but I suspect there shouldn't be any problems. Builds for non-x86 should behave exactly as before. If compiling the lib with the
benchmarked on Intel Core i9-12900KS |
Uh oh!
There was an error while loading. Please reload this page.
I brought this topic up in the discord server, but TL;DR I believe box3D could see some strong perf gains from increasing from 4 to 8 wide SIMD instructions. The majority of devices in use today support AVX2, and it's possible to detect support at runtime and switch out implementations with function pointers. I've been experimenting with this locally, applying it to the collideHulls code, and at one point it was working. I pulled in some changes from main, though, and at present the collision code is no longer working, but it is a proof of concept showing that runtime detection and switching is working. SSE works, and in theory AVX2 will work as soon as I can find the logic error.
All reactions