27 #ifndef fftwEnvironment_hpp
28 #define fftwEnvironment_hpp
32 #include "../../sys/environment.hpp"
51 template<
typename realT>
55 std::string fftw_typename<float>();
58 std::string fftw_typename<double>();
61 std::string fftw_typename<long double>();
65 std::string fftw_typename<__float128>();
75 template<
typename realT>
79 std::string sub =
"fftw_wisdom.";
84 sub =
".fftw_wisdom.";
87 std::string filename = path +
"/" + sub + fftw_typename<realT>();
120 template<
typename realT,
bool threads=false>
126 static_cast<void>(nThreads);
128 int rv = fftw_import_wisdom_from_filename<realT>(fftw_wisdom_filename<realT>().c_str());
136 int rv = fftw_export_wisdom_to_filename<realT>(fftw_wisdom_filename<realT>().c_str());
138 fftw_cleanup<realT>();
145 template<
typename realT>
146 struct fftwEnvironment<realT, true>
151 fftw_make_planner_thread_safe<realT>();
153 if(nThreads == 0) nThreads = 1;
154 fftw_plan_with_nthreads<realT>(nThreads);
156 fftw_import_wisdom_from_filename<realT>(fftw_wisdom_filename<realT>().c_str());
162 fftw_export_wisdom_to_filename<realT>(fftw_wisdom_filename<realT>().c_str());
164 fftw_cleanup_threads<realT>();
Declares and defines templatized wrappers for the fftw library.
std::string fftw_wisdom_filename()
Create the mxlib standard wisdom filename for the type.
std::string fftw_typename()
Return a string corresponding the fftw real floating point type.
std::string getEnv(const std::string &estr)
Return the value of an environment variable.
Manage the FFTW environment and wisdom using RAII.
~fftwEnvironment()
Destructor.
fftwEnvironment(unsigned nThreads=0)
Constructor.