diff --git a/bench/benchFFT.cpp b/bench/benchFFT.cpp index 3104929ba..0f0c9bb93 100644 --- a/bench/benchFFT.cpp +++ b/bench/benchFFT.cpp @@ -54,7 +54,7 @@ template <> string nameof() {return "long double";} using namespace Eigen; template -void bench(int nfft,bool fwd) +void bench(int nfft,bool fwd,bool unscaled=false, bool halfspec=false) { typedef typename NumTraits::Real Scalar; typedef typename std::complex Complex; @@ -63,16 +63,28 @@ void bench(int nfft,bool fwd) vector outbuf(nfft); FFT< Scalar > fft; + if (unscaled) { + fft.SetFlag(fft.Unscaled); + cout << "unscaled "; + } + if (halfspec) { + fft.SetFlag(fft.HalfSpectrum); + cout << "halfspec "; + } + + + std::fill(inbuf.begin(),inbuf.end(),0); fft.fwd( outbuf , inbuf); BenchTimer timer; timer.reset(); for (int k=0;k<8;++k) { timer.start(); - for(int i = 0; i < nits; i++) - if (fwd) + if (fwd) + for(int i = 0; i < nits; i++) fft.fwd( outbuf , inbuf); - else + else + for(int i = 0; i < nits; i++) fft.inv(inbuf,outbuf); timer.stop(); } @@ -86,6 +98,7 @@ void bench(int nfft,bool fwd) mflops /= 2; } + if (fwd) cout << " fwd"; else @@ -100,6 +113,9 @@ int main(int argc,char ** argv) bench >(NFFT,false); bench(NFFT,true); bench(NFFT,false); + bench(NFFT,false,true); + bench(NFFT,false,true,true); + bench >(NFFT,true); bench >(NFFT,false); bench(NFFT,true);