Node:Cycle Counters, Next:, Previous:Installation on non-Unix systems, Up:Installation and Customization



8.3 Cycle Counters

FFTW's planner actually executes and times different possible FFT algorithms in order to pick the fastest plan for a given n. In order to do this in as short a time as possible, however, the timer must have a very high resolution, and to accomplish this we employ the hardware cycle counters that are available on most CPUs. Currently, FFTW supports the cycle counters on x86, PowerPC/POWER, Alpha, UltraSPARC (SPARC v9), IA64, PA-RISC, and MIPS processors.

Access to the cycle counters, unfortunately, is a compiler and/or operating-system dependent task, and often requires inline assembly language, and it may be that your compiler is not supported. If you are not supported, you will get an error "Don't know a cycle counter for this system" during compilation of FFTW.

If you get this message indicating that your system is not supported, you can add support by editing the file kernel/cycle.h; normally, this will involve adapting one of the examples already present in order to use the inline-assembler syntax for your C compiler, and will only require a couple of lines of code. Anyone adding support for a new system to cycle.h is encouraged to email us at fftw@fftw.org.

If a cycle counter is not available on your system (e.g. some embedded processor), as a last resort you can use the --without-cycle-counter option to configure (on Unix) or #define WITHOUT_CYCLE_COUNTER in config.h (elsewhere). This will use the much slower gettimeofday function, or even clock if the former is unavailable, and planning will be extremely slow (you may just want to use FFTW_ESTIMATE).