[vsipl++] patch: enable/disable fftwf, fftw, and fftwl individually
Jules Bergmann
jules at codesourcery.com
Fri May 30 20:10:52 UTC 2008
Stefan Seefeld wrote:
> The attached patch probes at configure-time for those three libraries,
> defines VSIP_IMPL_FFTW3_HAVE_{FLOAT, DOUBLE, LONG_DOUBLE} appropriately,
> and then only enables and defines bindings for the available types.
>
> OK to check in ?
Stefan,
The provide_fft_{float,double,long_double} variables advertise to the
program what FFT types are supported. They are global across all the
different backends.
provide_fft_{float,double,long_double} are initially set to 0. If a
backend is enabled that provides a certain FFT (say SAL provides float
FFT, or IPP provides double), then the appropriate variable is set to
1. This gets used to set the VSIP_IMPL_PROVIDE_FFT_{TYPE} macros in
configure.ac.
If the FFTW3 BE clears these flags back to 0 as part of its
configuration logic, any 1's set by FFT BEs earlier in the list will be
overwritten.
An easy way to resolve this is to use a new set of variables specific
to FFTW3. "fftw3_has_{type}" for example.
-- Jules
> Index: m4/fft.m4
> ===================================================================
> --- m4/fft.m4 (revision 209798)
> +++ m4/fft.m4 (working copy)
> @@ -184,7 +184,6 @@
> LIBS=$keep_LIBS])
> fi
> fi
> -
> if test "$enable_builtin_fft" != "no"; then
>
> AC_MSG_NOTICE([Using built-in FFTW3 support.])
> @@ -206,15 +205,19 @@
> AC_MSG_RESULT([not a supported type.])
> AC_MSG_NOTICE([Disabling FFT support (--disable-fft-long-double).])
> enable_fft_long_double=no
> + provide_fft_long_double=0
This may hide a '1' set by another BE.
> elif test $ac_cv_sizeof_long_double = $ac_cv_sizeof_double; then
> AC_MSG_RESULT([same size as double.])
> AC_MSG_NOTICE([Disabling FFT support (--disable-fft-long-double).])
> enable_fft_long_double=no
> + provide_fft_long_double=0
Likewise.
> else
> AC_MSG_RESULT([supported.])
> + provide_fft_long_double=1
> fi
> + provide_fft_float=1
> + provide_fft_double=1
The idea is that provide_fft_{type} is initialized to 0, then set to
1 when BE support is discovered. Setting to 1 first, then clearing if
FFTW3 doesn't support the type won't play nicely with other backends.
> Index: src/vsip/opt/fftw3/fft.hpp
These changes look good.
> Index: src/vsip/opt/fftw3/fft.cpp
Likewise.
--
Jules Bergmann
CodeSourcery
jules at codesourcery.com
(650) 331-3385 x705
More information about the vsipl++
mailing list