[vsipl++] Fast convolution (slow!)
Jules Bergmann
jules at codesourcery.com
Tue Aug 5 19:44:25 UTC 2008
Gaetano Mendola wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi all,
> I'm evaluating VSIPL++ for an application heavily based on convolutions.
Gaetano,
Thank you for evaluating VSIPL++! We'll try to answer your questions
as best we can to make sure your evaluation is a success.
VSIPL++ separates the creation of an FFT object (the 'fwd_fft_type
fwd_fft') from the invocation (the 'fwd_fft(inputs, outputs') to allow
potentially expensive setup computations to occur "outside" the
computation inner loop. For example, a simple FFT backend might
pre-compute twiddle factors, while a more elaborate backend might
determine which FFT choices (radix, DIF vs DIT, etc) is best suited
for the architecture. The intent is that setup computations will be
amortized over a large number of FFT invocations.
That is occurring here. The FFT backend use by VSIPL++ (persumably
FFTW3) is spending considerable time planning the FFTs (20 sec per
FFT) to give an efficient execution.
If you really are performing the convolution only once
(i.e. preventing the setup time from being amortized), you might
consider setting the "number of times" template parameter to 1. This
will tell the FFT BE to spend less effort planning. This will slow
the FFT itself, but the overall time should be smaller. The default
number of times is 0 corresponds to "infinite", which results in a
large planning effort.
typedef vsip::Fft<vsip::const_Vector, T, T, vsip::fft_fwd,
vsip::by_reference,
1 // Number of times
> fwd_fft_type;
You might also consider using another FFT backend library besides
FFTW3. IPP may spend less time planning, without sacrificing
performance. However, IPP may have poorer performance on
non-power-of-2 FFTs.
Also, to be clear, what FFT library are you using? Is it the default
provided by VSIPL++ (FFTW3), or another one?
thanks,
-- Jules
--
Jules Bergmann
CodeSourcery
jules at codesourcery.com
(650) 331-3385 x705
More information about the vsipl++
mailing list