GUILLAUME WILLIAM
BRES
FFTW for ARM using FPUs:
Compute DFT really fast,
How to Cross-Compile the library for ARM chips, how to optimize it for the latest FPUs.
Buildroot patch to optimize the lib as soon as an FPU is available.
Buildroot patch: optimize the library as soon as an FPU is available.
Cross-compile the lib:
Cross-compile a program:
Optimize for NEON and Cross-compile the lib:
Cross-compile a program:
Cortex-a9 benchmark:
MFlops(c2r) = 5 * Nfft * log2(Nfft) / T1fft(usec).
MFlops(r2c) = 5/2 Nfft * log2(Nfft) / T1fft(usec).
retrieve the latest version from:
http://www.fftw.org/download.html
cd fftw-x.x.x
export CC=/[...]/toolchain
./configure CC=/[...]/toolchain
make
make DESTDIR=/[...]/custom_build
export CC=/[...]/toolchain
${CC} -o main main.c -lfftw3 -lm \
-I/[...]/custom_build/usr/include -L/[...]/custom_build/usr/lib
retrieve the latest version from:
http://www.fftw.org/download.html
cd fftw-x.x.x
export CC=/[...]/toolchain
./configure CC=/[...]/toolchain --enable-single --enable-neon \
--enable_threads --enable-arm-v7a-cycle-counter \
ARM_CPU_TYPE=cortex-a9 \
ARM_CPU_ABI=softfp
make
make DESTDIR=/[...]/custom_build
export CC=/[...]/toolchain
${CC} -o main main.c -lfftw3f -lm \
-I/[...]/custom_build/usr/include -L/[...]/custom_build/usr/lib
How to:
cd buildroot
make menuconfig
-> target packages ->toolchain
-> libraries -> [*]Wchar
-> others -> [*]C++
-> [*] <fftw>
make
--- fftw.mk 2015-02-23 19:20:04.849545269 -0700
+++ fftw_fpu.mk 2015-02-23 19:26:47.598136607 -0700
@@ -10,4 +10,17 @@
FFTW_LICENSE = GPLv2+
FFTW_LICENSE_FILES = COPYING
+ifeq ($(BR2_ARM_ENABLE_NEON),y)
+FFTW_CONF_OPTS+= --with-mode=arm
+FFTW_CONF_OPTS+= --enable-languages=c,c++
+FFTW_CONF_OPTS+= ARM_FLOAT_ABI=softfp
+FFTW_CONF_OPTS+= --disable-fortran
+FFTW_CONF_OPTS+= --enable-single
+FFTW_CONF_OPTS+= --enable-neon
+FFTW_CONF_OPTS+= CFLAGS="$(TARGET_CFLAGS)-Ofast -mfpu=neon -mfloat-abi=softfp"
+endif
+
$(eval $(autotools-package))
hosted on my git@github.com/guillaumeWBres/buildroot-patch