cuFFT

Provides FFT and inverse FFT for 1D, 2D and 3D arrays. See NVIDIA cuFFT.

Note

cuFFT only supports FFT operations on numpy.float32, numpy float64, numpy.complex64, numpy.complex128 with C-contiguous datalayout.

Forward FFT

pyculib.fft.fft(ary, out[, stream])
pyculib.fft.fft_inplace(ary[, stream])
Parameters:
  • ary – The input array. The inplace version stores the result in here.
  • out – The output array for non-inplace versions.
  • stream – The CUDA stream in which all operations will take place.

Inverse FFT

pyculib.fft.ifft(ary, out[, stream])
pyculib.fft.ifft_inplace(ary[, stream])
Parameters:
  • ary – The input array. The inplace version stores the result in here.
  • out – The output array for non-inplace versions.
  • stream – The CUDA stream in which all operations will take place.

FFTPlan

class pyculib.fft.FFTPlan(shape, itype, otype, batch=1, stream=0, mode=1)
Parameters:
  • shape – Input array shape.
  • itype – Input data type.
  • otype – Output data type.
  • batch – Maximum number of operation to perform.
  • stream – A CUDA stream for all the operations to put on.
  • mode – Operation mode; e.g. MODE_NATIVE, MODE_FFTW_PADDING, MODE_FFTW_ASYMMETRIC, MODE_FFTW_ALL, MODE_DEFAULT.
forward(ary, out=None)

Perform forward FFT

Parameters:
  • ary – Input array
  • out – Optional output array
Returns:

The output array or a new numpy array is out is None.

Note

If ary is out, an inplace operation is performed.

inverse(ary, out=None)

Perform inverse FFT

Parameters:
  • ary – Input array
  • out – Optional output array
Returns:

The output array or a new numpy array is out is None.