From 2e45927e04909c3f7c396e910b46e78cc81e91a7 Mon Sep 17 00:00:00 2001 From: Francois Coppens Date: Mon, 30 Jan 2023 17:35:11 +0100 Subject: [PATCH] Added AVX2 detection to autoconfig script. Fixed minor SIMD bug in tests. --- configure.ac | 2 ++ org/qmckl_sherman_morrison_woodbury.org | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index cefb260..727c585 100644 --- a/configure.ac +++ b/configure.ac @@ -223,6 +223,8 @@ AC_RUN_IFELSE( int simd=1; #if defined(__AVX512F__) simd=8; +#elif defined(__AVX2__) + simd=4; #elif defined(__AVX__) simd=4; #elif defined(__SSE2__) diff --git a/org/qmckl_sherman_morrison_woodbury.org b/org/qmckl_sherman_morrison_woodbury.org index 71d6544..fcceed9 100644 --- a/org/qmckl_sherman_morrison_woodbury.org +++ b/org/qmckl_sherman_morrison_woodbury.org @@ -418,7 +418,7 @@ The tests for the kernels are executed on datasets that are extracted from a run #+begin_src c :tangle (eval c_test) const uint64_t Dim = 21; -const uint64_t LDS = (1 + (Dim) / SIMD_LENGTH) * SIMD_LENGTH; +const uint64_t LDS = (1+(Dim-1)/SIMD_LENGTH)*SIMD_LENGTH; const double breakdown = 1e-3; const double tolerance = 1e-3; double res[441];