Simple N-body codes using C++ experimental simd support
On a Linux workstation with GCC 11+ (or clang?), this should be as easy as
make
./nvortex2d.bin
./nvortex3d.bin -n=30000
We should be able to iterate over a std::vector<float>
but cast it to a simd type just before the kernel.
This will be a copy of nvortexVc but using the C++-built-in experimental simd extensions.
Learn more about experimental/simd
at cppreference and stackoverflow.
Note that GCC will auto-vectorize the 2D code, but not the 3D code (too many registers?). Unlike Vc, there is no vectorized square root yet, so the 3D code is much slower than the 2D code now.