nabu.processing.fft_cuda
source module nabu.processing.fft_cuda
Classes
-
VKCUFFT — Cuda FFT, using VKFFT backend
Functions
-
has_vkfft — Determine whether pyvkfft is available. For Cuda GPUs, vkfft relies on nvrtc which supports a narrow range of Cuda devices. Unfortunately, it's not possible to determine whether vkfft is available before creating a Cuda context. So we create a process (from scratch, i.e no fork), do the test within, and exit. This function cannot be tested from a notebook/console, a proper entry point has to be created (if name == "main").
source get_vkfft_cuda(slf, *args, **kwargs)
source class VKCUFFT(shape, dtype, r2c=True, axes=None, normalize='rescale', **backend_options)
Bases : _BaseVKFFT
Cuda FFT, using VKFFT backend
Base class for Fast Fourier Transform (FFT).
Parameters
-
shape : list of int — Shape of the input data
-
dtype : str or numpy.dtype — Data type of the input data
-
r2c : bool, optional — Whether to use real-to-complex transform for real-valued input. Default is True.
-
axes : list of int, optional — Axes along which FFT is computed. * For 2D transform: axes=(1,0) * For batched 1D transform of 2D image: axes=(-1,)
-
normalize : str, optional — Whether to normalize FFT and IFFT. Possible values are: * "rescale": in this case, Fourier data is divided by "N" before IFFT, so that IFFT(FFT(data)) = data. This corresponds to numpy norm=None i.e norm="backward". * "ortho": in this case, FFT and IFFT are adjoint of eachother, the transform is unitary. Both FFT and IFFT are scaled with 1/sqrt(N). * "none": no normalizatio is done : IFFT(FFT(data)) = data*N
Other Parameters
backend_options: dict, optional Parameters to pass to CudaProcessing or OpenCLProcessing class.
Determine whether pyvkfft is available. For Cuda GPUs, vkfft relies on nvrtc which supports a narrow range of Cuda devices. Unfortunately, it's not possible to determine whether vkfft is available before creating a Cuda context. So we create a process (from scratch, i.e no fork), do the test within, and exit. This function cannot be tested from a notebook/console, a proper entry point has to be created (if name == "main").
source get_fft_class(backend='vkfft')
Raises
-
RuntimeError