Skip to content

Commit 6599db2

Browse files
authored
fix: rms avx2 bug. (#137)
1 parent c09173b commit 6599db2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/funcs.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ float rms(const float* x, const unsigned int size) {
105105
ss = vaddvq_f32(fs);
106106
#elif defined(__AVX2__)
107107
assert(size % 8 == 0);
108-
__m256 a, u;
108+
__m256 a;
109+
__m256 u = _mm256_set1_ps(0.0f);
109110
for (unsigned int j = 0; j < size; j += 8) {
110111
a = _mm256_loadu_ps(&x[j]);
111112
u = _mm256_fmadd_ps(a, a, u);

0 commit comments

Comments
 (0)