summaryrefslogtreecommitdiff
path: root/fourier.cpp
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2025-04-05 20:50:12 -0300
committerJaron Kent-Dobias <jaron@kent-dobias.com>2025-04-05 20:50:12 -0300
commitf65b97b96ec4111807222fd95057813a454a2bea (patch)
tree4e5162dca4347a5604ad207fd8cf81fcf48fc2fd /fourier.cpp
parent8328c8294c144e30310c79e15c80a5bf06315bf0 (diff)
downloadcode-f65b97b96ec4111807222fd95057813a454a2bea.tar.gz
code-f65b97b96ec4111807222fd95057813a454a2bea.tar.bz2
code-f65b97b96ec4111807222fd95057813a454a2bea.zip
Enable multithreaded FFTW with openmp
Diffstat (limited to 'fourier.cpp')
-rw-r--r--fourier.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/fourier.cpp b/fourier.cpp
index 0c22637..c2ed600 100644
--- a/fourier.cpp
+++ b/fourier.cpp
@@ -25,6 +25,8 @@ Real ddf(Real λ, unsigned p, unsigned s, Real q) {
}
FourierTransform::FourierTransform(unsigned n, Real Δω, Real Δτ, unsigned flags) : a(2 * n), â(n + 1), Δω(Δω), Δτ(Δτ) {
+ fftw_init_threads();
+ fftw_plan_with_nthreads(FFTW_THREADS);
fftw_import_wisdom_from_filename("fftw.wisdom");
plan_r2c = fftw_plan_dft_r2c_1d(2 * n, a.data(), reinterpret_cast<fftw_complex*>(â.data()), flags);
plan_c2r = fftw_plan_dft_c2r_1d(2 * n, reinterpret_cast<fftw_complex*>(â.data()), a.data(), flags);