FFT#

class nvmath.device.FFT(
size,
precision,
fft_type,
execution,
*,
sm=None,
direction=None,
ffts_per_block=None,
elements_per_thread=None,
real_fft_options=None,
)[source]#

A class that encapsulates a partial FFT device function. A partial device function can be queried for available or optimal values for some knobs (such as ffts_per_block or elements_per_thread). It does not contain a compiled, ready-to-use, device function until finalized using create().

Changed in version 0.7.0: FFT has replaced FFTOptions and FFTOptionsComplete.

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'.

  • sm (ComputeCapability) – Target mathdx compute-capability.

  • 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 this class provide a 1:1 mapping with the CUDA C++ cuFFTDx APIs. For further details, please refer to cuFFTDx documentation.

Methods

__init__(
size,
precision,
fft_type,
execution,
*,
sm=None,
direction=None,
ffts_per_block=None,
elements_per_thread=None,
real_fft_options=None,
)[source]#
create(**kwargs)[source]#

Creates a copy of the instance with provided arguments updated.

Deprecated since version 0.7.0: Please use functools.partial() instead.

definition()[source]#

Deprecated since version 0.7.0.

execute()[source]#
valid(*knobs)[source]#

Attributes

block_dim#
direction#
elements_per_thread#
execution#
extensions#
fft_type#
ffts_per_block#
files#
implicit_type_batching#
input_type#
output_type#
precision#
real_fft_options#
requires_workspace#
shared_memory_size#
size#
sm#
storage_size#
stride#
value_type#
workspace_size#