std1.0.0-beta-7 SafeC docs

Module dsp::fft_rocm

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

FFT on AMD GPUs (hipFFT / rocFFT).

GPU counterparts of fft.h and imaging.h's fft2d, plus device-resident fp32 transforms on gpu_rocm.h's RocmBufs. All work is queued on gpu_rocm's stream, so it orders with the RocmBuf ops there. Same API as dsp/fft_cuda.h, with rocm_ in place of cuda_.

Unlike fft.h these accept any length n >= 1, not only powers of two (rocFFT handles mixed radices and, via Bluestein, primes). Each (kind, size, batch) gets a hipFFT plan the first time it is used, kept in a small cache; make that first call outside graph capture. Link with: -lhipfft plus gpu_rocm's -lamdhip64 -lhiprtc -lrocblas.

Functions

rocm_fft
rocm_ifft
rocm_fft_batch'batch' independent length-n transforms stored back to back, in one call.
rocm_fft2d2D transform of a row-major h x w image (imaging.h's fft2d / ifft2d); 0 when img holds fewer than h * w values.
rocm_ifft2d
rocm_fft_c2cbatch x n complex -> batch x n complex. in == out is allowed.
rocm_fft_r2cbatch x n real -> batch x (n/2 + 1) complex (the non-redundant half).
rocm_fft_c2rbatch x (n/2 + 1) complex -> batch x n real. May overwrite 'in' (rocFFT's complex-to-real transforms use their input as scratch).