From 05966dc890046af046e8c210e233088d2ced1c61 Mon Sep 17 00:00:00 2001 From: Bernhard Manfred Gruber Date: Mon, 1 Jan 2024 23:44:51 +0100 Subject: [PATCH] Make n-body SIMD width configurable at the top --- examples/nbody/nbody.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/nbody/nbody.cpp b/examples/nbody/nbody.cpp index 8f71f2e7f0..b0fa810090 100644 --- a/examples/nbody/nbody.cpp +++ b/examples/nbody/nbody.cpp @@ -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}; @@ -381,7 +382,8 @@ namespace usellama for(std::size_t s = 0; s < steps + 1; ++s) { #ifdef HAVE_XSIMD - constexpr auto width = llama::simdLanesWithFullVectorsFor; + constexpr auto width + = llamaSimdLanes == -1 ? llama::simdLanesWithFullVectorsFor : llamaSimdLanes; #endif if constexpr(runUpdate) {