Chris@10: Chris@10: Chris@10: Generating your own code - FFTW 3.3.3 Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10: Chris@10:
Chris@10: Chris@10:

Chris@10: Previous: Cycle Counters, Chris@10: Up: Installation and Customization Chris@10:


Chris@10:
Chris@10: Chris@10:

10.4 Generating your own code

Chris@10: Chris@10:

Chris@10: The directory genfft contains the programs that were used to Chris@10: generate FFTW's “codelets,” which are hard-coded transforms of small Chris@10: sizes. Chris@10: We do not expect casual users to employ the generator, which is a rather Chris@10: sophisticated program that generates directed acyclic graphs of FFT Chris@10: algorithms and performs algebraic simplifications on them. It was Chris@10: written in Objective Caml, a dialect of ML, which is available at Chris@10: http://caml.inria.fr/ocaml/index.en.html. Chris@10: Chris@10: Chris@10:

If you have Objective Caml installed (along with recent versions of Chris@10: GNU autoconf, automake, and libtool), then you Chris@10: can change the set of codelets that are generated or play with the Chris@10: generation options. The set of generated codelets is specified by the Chris@10: {dft,rdft}/{codelets,simd}/*/Makefile.am files. For example, you can add Chris@10: efficient REDFT codelets of small sizes by modifying Chris@10: rdft/codelets/r2r/Makefile.am. Chris@10: After you modify any Makefile.am files, you can type sh Chris@10: bootstrap.sh in the top-level directory followed by make to Chris@10: re-generate the files. Chris@10: Chris@10:

We do not provide more details about the code-generation process, since Chris@10: we do not expect that most users will need to generate their own code. Chris@10: However, feel free to contact us at fftw@fftw.org if Chris@10: you are interested in the subject. Chris@10: Chris@10:

You might find it interesting to learn Caml and/or some modern Chris@10: programming techniques that we used in the generator (including monadic Chris@10: programming), especially if you heard the rumor that Java and Chris@10: object-oriented programming are the latest advancement in the field. Chris@10: The internal operation of the codelet generator is described in the Chris@10: paper, “A Fast Fourier Transform Compiler,” by M. Frigo, which is Chris@10: available from the FFTW home page and also Chris@10: appeared in the Proceedings of the 1999 ACM SIGPLAN Conference on Chris@10: Programming Language Design and Implementation (PLDI). Chris@10: Chris@10: Chris@10: