std1.0.0-beta-7 SafeC docs

Module dsp::fft_core

#include <std/dsp/fft_core.h> source

FFT core, written once for both precisions.

Internal: included by fft.sc (double, Complex) and fft_f32.sc (float, ComplexF), each its own translation unit, so every static here exists once per precision. The includer defines, before including:

FFT_R           the real type (double / float)
FFT_V2, FFT_V4, FFT_V8  2-, 4- and 8-lane vectors of it (one, two, four
                complex values)
FFT_SINGLE      0 for double, 1 for float
FFT_DFTI_CREATE oneMKL's descriptor constructor for that precision

and includes the headers fft.sc lists. Not a public header.

Structs

FftConstTable
FftRevTable
FftJob
FftBatchJob

Macros

FFT_HAS_THREADS
FFT_CONST_N
FFT_BLOCKStages up to this length run block by block, so a block (2^11 complex = 32 KB) stays in L1/L2 through all of them.
FFT_ONE_BLOCKTransforms up to this length run as one block (64 KB in double: L2), so every stage is in the radix-4 pairing and there is no separate outer pass.
FFT_PAR_MINSingle transforms at least this long use the thread pool.
FFT_REV_LOGSCompile-time bit-reversal swap lists for every length up to FFT_CONST_N: for n = 2^L, the pairs (i, rev i) with i < rev i, in increasing i, at p[2 * off[L] ..]. Swapping from a list skips the per-element index walk and the unpredictable i < j branch of the loop below.
FFT_SQRT1_2Radix-8: the radix-2 stages of length 2m, 4m and 8m fused (m >= 4), so each group of eight values is loaded and stored once instead of three times (radix-8 passes as in SPIRAL/FFTE's 8^q 16^r factorizations). For q in [q0, q1) (n/8 groups per pass), block q / m, k = q % m:
FFT_VENDOR
FFT_PLANS
FFT_VENDOR_SINGLE_MAXfft_n_()/ifft_n_() at or above this length use the built-in threaded transform instead of one single-threaded library call.
FFT_KIND_C2Cin place, forward and backward (backward scaled by 1/n)
FFT_KIND_R2Cout of place, n/2 + 1 complex outputs
FFT_MODE_RTfft_run_'s 'mode': who may run the transform.
FFT_MODE_TOPa top-level call: library or built-in threads
FFT_MODE_ROWone row of a batch already on the pool: library, no threads