Module dsp::fft_cuda
FFT on NVIDIA GPUs (cuFFT).
GPU counterparts of fft.h and imaging.h's fft2d, plus device-resident fp32 transforms on gpu_cuda.h's CudaBufs. All work is queued on gpu_cuda's stream, so it orders with the CudaBuf ops there.
Unlike fft.h these accept any length n >= 1, not only powers of two (cuFFT handles mixed radices and, via Bluestein, primes). Each (kind, size, batch) gets a cuFFT plan the first time it is used, kept in a small cache; make that first call outside graph capture. Link with: -lcufft plus gpu_cuda's -lcuda -lcublas -lcublasLt -lnvrtc.
Functions
| cuda_fft | |
| cuda_ifft | |
| cuda_fft_batch | 'batch' independent length-n transforms stored back to back, in one call. |
| cuda_fft2d | 2D transform of a row-major h x w image (imaging.h's fft2d / ifft2d); 0 when img holds fewer than h * w values. |
| cuda_ifft2d | |
| cuda_fft_c2c | batch x n complex -> batch x n complex. in == out is allowed. |
| cuda_fft_r2c | batch x n real -> batch x (n/2 + 1) complex (the non-redundant half). |
| cuda_fft_c2r | batch x (n/2 + 1) complex -> batch x n real. Overwrites 'in' (cuFFT's complex-to-real transforms use their input as scratch). |