Skip to content

Commit 8419c47

Browse files
Fixes
1 parent 6219b23 commit 8419c47

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

chowdsp_fft.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ FFT_Setup* fft_new_setup (int N, fft_transform_t transform);
9090
void fft_destroy_setup (FFT_Setup* s);
9191
void pffft_transform_internal (FFT_Setup* setup, const float* finput, float* foutput, void* scratch, fft_direction_t direction, int ordered);
9292
void pffft_convolve_internal (FFT_Setup* setup, const float* a, const float* b, float* ab, float scaling);
93+
void fft_accumulate_internal (FFT_Setup* setup, const float* a, const float* b, float* ab, int N);
9394
} // namespace chowdsp::fft::avx
9495
static constexpr uintptr_t address_mask = ~static_cast<uintptr_t> (3);
9596
static constexpr uintptr_t typeid_mask = static_cast<uintptr_t> (3);
@@ -409,15 +410,15 @@ void fft_accumulate (void* setup, const float* a, const float* b, float* ab, int
409410
#if CHOWDSP_FFT_COMPILER_SUPPORTS_AVX
410411
if (check_is_pointer_sse_setup (setup))
411412
{
412-
sse::fft_accumulate_internal (reinterpret_cast<sse::FFT_Setup*> (setup),
413+
sse::fft_accumulate_internal (reinterpret_cast<sse::FFT_Setup*> (get_setup_pointer (setup)),
413414
a,
414415
b,
415416
ab,
416417
N);
417418
}
418419
else
419420
{
420-
avx::fft_accumulate_internal (reinterpret_cast<avx::FFT_Setup*> (setup),
421+
avx::fft_accumulate_internal (reinterpret_cast<avx::FFT_Setup*> (get_setup_pointer (setup)),
421422
a,
422423
b,
423424
ab,

simd/chowdsp_fft_impl_avx.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2029,9 +2029,9 @@ void pffft_convolve_internal (FFT_Setup* setup, const float* a, const float* b,
20292029
}
20302030
}
20312031

2032-
void fft_accumulate_internal (FFT_Setup* setup, const float* a, const float* b, float* ab, int N)
2032+
void fft_accumulate_internal ([[maybe_unused]] FFT_Setup* setup, const float* a, const float* b, float* ab, int N)
20332033
{
2034-
assert (N % SIMD_SZ == 0);
2034+
assert (N % (SIMD_SZ * 2) == 0);
20352035
const auto Ncvec = N / (int) SIMD_SZ;
20362036
auto* va = (const __m256*) a;
20372037
auto* vb = (const __m256*) b;

simd/chowdsp_fft_impl_neon.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1677,7 +1677,7 @@ void pffft_convolve_internal (FFT_Setup* setup, const float* a, const float* b,
16771677

16781678
void fft_accumulate_internal (FFT_Setup* setup, const float* a, const float* b, float* ab, int N)
16791679
{
1680-
assert (N % SIMD_SZ == 0);
1680+
assert (N % (SIMD_SZ * 2) == 0);
16811681
const auto Ncvec = N / (int) SIMD_SZ;
16821682
auto* va = (const float32x4_t*) a;
16831683
auto* vb = (const float32x4_t*) b;

simd/chowdsp_fft_impl_sse.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,7 @@ void pffft_convolve_internal (FFT_Setup* setup, const float* a, const float* b,
16921692

16931693
void fft_accumulate_internal (FFT_Setup* setup, const float* a, const float* b, float* ab, int N)
16941694
{
1695-
assert (N % SIMD_SZ == 0);
1695+
assert (N % (SIMD_SZ * 2) == 0);
16961696
const auto Ncvec = N / (int) SIMD_SZ;
16971697
auto* va = (const __m128*) a;
16981698
auto* vb = (const __m128*) b;

test/test.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ void test_fft_complex (int N, bool use_avx = false)
3030
auto* fft_setup = chowdsp::fft::fft_new_setup (N, chowdsp::fft::FFT_COMPLEX, use_avx);
3131
REQUIRE (fft_setup != nullptr);
3232
auto* pffft_setup = pffft_new_setup (N, PFFFT_COMPLEX);
33-
34-
if (use_avx)
35-
REQUIRE (chowdsp::fft::fft_simd_width_bytes (fft_setup) == 32);
36-
else
33+
if (! use_avx)
3734
REQUIRE (chowdsp::fft::fft_simd_width_bytes (fft_setup) == 16);
3835

3936
chowdsp::fft::fft_transform (fft_setup, data, data, work_data, chowdsp::fft::FFT_FORWARD);

0 commit comments

Comments
 (0)