Search code examples
simdsseavxfftwavx2

Does FFTW determine SIMD version dynamically?


For example, if I compile FFTW with AVX2 support and run it in a machine that only have SSE3, would it check and use SSE3 instructions, or just crash immediately?

If it won't dynamically determine SIMD version, I would compile it under a lower target machine.


Solution

  • From the install docs at https://www.fftw.org/fftw3_doc/Installation-on-Unix.html

    --enable-sse (single precision), ... and --enable-generic-simd256:

    Enable various SIMD instruction sets. You need compiler that supports the given SIMD extensions, but FFTW will try to detect at runtime whether the CPU supports these extensions. That is, you can compile with--enable-avx and the code will still run on a CPU without AVX support.

    I don't know whether it will try multiple lower levels of support if the requested target isn't available.