From 6599db2b1c767389eff546ef9b0343c54da02ad0 Mon Sep 17 00:00:00 2001 From: Bart Tadych Date: Sun, 17 Nov 2024 14:40:41 +0100 Subject: [PATCH] fix: rms avx2 bug. (#137) --- src/funcs.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/funcs.cpp b/src/funcs.cpp index 91750e1..508f410 100644 --- a/src/funcs.cpp +++ b/src/funcs.cpp @@ -105,7 +105,8 @@ float rms(const float* x, const unsigned int size) { ss = vaddvq_f32(fs); #elif defined(__AVX2__) assert(size % 8 == 0); - __m256 a, u; + __m256 a; + __m256 u = _mm256_set1_ps(0.0f); for (unsigned int j = 0; j < size; j += 8) { a = _mm256_loadu_ps(&x[j]); u = _mm256_fmadd_ps(a, a, u);