Skip to content

Commit

Permalink
MNN:Bugfix: Fix compile bug for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaying committed Dec 31, 2024
1 parent 27da5e7 commit 42b37ac
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source/backend/cpu/CPUStft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#define M_PI 3.141592654
#endif
#include <algorithm>
#include <cmath>
#include "backend/cpu/CPUStft.hpp"
#include "backend/cpu/CPUBackend.hpp"
#include "core/Concurrency.h"
Expand All @@ -27,10 +28,10 @@ static void MNNDftAbs(const float* input, const float* window, float* output, fl
float real_sum = 0.f, imag_sum = 0.f;
for (int n = 0; n < nfft; ++n) {
float angle = 2 * M_PI * k * n / nfft;
real_sum += buffer[n] * std::cos(angle);
imag_sum -= buffer[n] * std::sin(angle);
real_sum += buffer[n] * cosf(angle);
imag_sum -= buffer[n] * sinf(angle);
}
output[k] = std::sqrt(real_sum * real_sum + imag_sum * imag_sum);
output[k] = sqrtf(real_sum * real_sum + imag_sum * imag_sum);
}
}

Expand Down

0 comments on commit 42b37ac

Please sign in to comment.