Skip to content

Commit

Permalink
Make n-body SIMD width configurable at the top
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Jan 1, 2024
1 parent 1c2e499 commit 05966dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/nbody/nbody.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ constexpr auto dumpMapping = false;
constexpr auto allowRsqrt = false; // rsqrt can be way faster, but less accurate
constexpr auto newtonRaphsonAfterRsqrt = true; // generate a newton raphson refinement after explicit calls to rsqrt()
constexpr auto runUpdate = true; // run update step. Useful to disable for benchmarking the move step.
constexpr auto llamaSimdLanes = -1; // SIMD lanes to use for LLAMA, -1 lets LLAMA choose

constexpr auto timestep = FP{0.0001};
constexpr auto eps2 = FP{0.01};
Expand Down Expand Up @@ -381,7 +382,8 @@ namespace usellama
for(std::size_t s = 0; s < steps + 1; ++s)
{
#ifdef HAVE_XSIMD
constexpr auto width = llama::simdLanesWithFullVectorsFor<Particle, MakeBatch>;
constexpr auto width
= llamaSimdLanes == -1 ? llama::simdLanesWithFullVectorsFor<Particle, MakeBatch> : llamaSimdLanes;
#endif
if constexpr(runUpdate)
{
Expand Down

0 comments on commit 05966dc

Please sign in to comment.