fft#

nvmath.device.fft(*, compiler=None, **kwargs)[source]#

Create an FFTOptions object that encapsulates a compiled and ready-to-use FFT device function.

Parameters:
  • size (int) – The size of the FFT to calculate.

  • precision (str) – The computation precision specified as a numpy float dtype, currently supports numpy.float16, numpy.float32 and numpy.float64.

  • fft_type (str) – A string specifying the type of FFT operation, can be 'c2c', 'c2r' or 'r2c'.

  • compiler (str) – A string to specify the compiler for the device code, currently supports None (default) and 'Numba'

  • code_type (CodeType) – The target GPU code and compute-capability.. Optional if compiler is specified as 'Numba'.

  • execution (str) – A string specifying the execution method, can be 'Block' or 'Thread'.

  • direction (str) – A string specifying the direction of FFT, can be 'forward' or 'inverse'. If not provided, will be 'forward' if complex-to-real FFT is specified and 'inverse' if real-to-complex FFT is specified.

  • ffts_per_block (int) – The number of FFTs calculated per CUDA block, optional. The default is 1. Alternatively, if provided as 'suggested', will be set to a suggested value

  • elements_per_thread (int) – The number of elements per thread, optional. The default is 1. Alternatively, if provided as 'suggested', will be set to a suggested value.

  • real_fft_options (dict) –

    A dictionary specifying the options for real FFT operation, optional. User may specify the following options in the dictionary:

    • 'complex_layout', currently supports 'natural', 'packed', and 'full'.

    • 'real_mode', currently supports 'normal' and 'folded'.

See also

The attributes of FFTOptions provide a 1:1 mapping with the CUDA C++ cuFFTDx APIs. For further details, please refer to cuFFTDx documentation.

Examples

Examples can be found in the nvmath/examples/device directory.