Skip to content

Commit

Permalink
fix: rms avx2 bug. (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
b4rtaz authored Nov 17, 2024
1 parent c09173b commit 6599db2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/funcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6599db2

Please sign in to comment.