(x_gpu, y_gpu, plan, direction, scale=None)
Fast Fourier Transform.

    Parameters
    ----------
    x_gpu : pycuda.gpuarray.GPUArray
        Input array.
    y_gpu : pycuda.gpuarray.GPUArray
        Output array.
    plan : Plan
        FFT plan.
    direction : { cufft.CUFFT_FORWARD, cufft.CUFFT_INVERSE }
        Transform direction. Only affects in-place transforms.

    Optional Parameters
    -------------------
    scale : int or float
        Scale the values in the output array by dividing them by this value.

    Notes
    -----
    This function should not be called directly.
Fast Fourier Transform.
Fast Fourier Transform .
def _fft(x_gpu, y_gpu, plan, direction, scale=None):
    """
    Fast Fourier Transform.

    Parameters
    ----------
    x_gpu : pycuda.gpuarray.GPUArray
        Input array.
    y_gpu : pycuda.gpuarray.GPUArray
        Output array.
    plan : Plan
        FFT plan.
    direction : { cufft.CUFFT_FORWARD, cufft.CUFFT_INVERSE }
        Transform direction. Only affects in-place transforms.

    Optional Parameters
    -------------------
    scale : int or float
        Scale the values in the output array by dividing them by this value.

    Notes
    -----
    This function should not be called directly.
    """

    if (x_gpu.gpudata == y_gpu.gpudata) and \
           plan.fft_type not in [cufft.CUFFT_C2C, cufft.CUFFT_Z2Z]:
        raise ValueError('can only compute in-place transform of complex data')

    if direction == cufft.CUFFT_FORWARD and \
           plan.in_dtype in np.sctypes['complex'] and \
           plan.out_dtype in np.sctypes['float']:
        raise ValueError('cannot compute forward complex -> real transform')

    if direction == cufft.CUFFT_INVERSE and \
           plan.in_dtype in np.sctypes['float'] and \
           plan.out_dtype in np.sctypes['complex']:
        raise ValueError('cannot compute inverse real -> complex transform')

    if plan.fft_type in [cufft.CUFFT_C2C, cufft.CUFFT_Z2Z]:
        plan.fft_func(plan.handle, int(x_gpu.gpudata), int(y_gpu.gpudata),
                      direction)
    else:
        plan.fft_func(plan.handle, int(x_gpu.gpudata),
                      int(y_gpu.gpudata))

    # Scale the result by dividing it by the number of elements:
    if scale is not None:
        func = _get_scale_kernel(y_gpu.dtype)
        func(y_gpu.dtype.type(scale), y_gpu)
def _fft ( x_gpu , y_gpu , plan , direction , scale = None ) : if ( x_gpu . gpudata == y_gpu . gpudata ) and plan . fft_type not in [ cufft . CUFFT_C2C , cufft . CUFFT_Z2Z ] : raise ValueError ( 'can only compute in-place transform of complex data' ) if direction == cufft . CUFFT_FORWARD and plan . in_dtype in np . sctypes [ 'complex' ] and plan . out_dtype in np . sctypes [ 'float' ] : raise ValueError ( 'cannot compute forward complex -> real transform' ) if direction == cufft . CUFFT_INVERSE and plan . in_dtype in np . sctypes [ 'float' ] and plan . out_dtype in np . sctypes [ 'complex' ] : raise ValueError ( 'cannot compute inverse real -> complex transform' ) if plan . fft_type in [ cufft . CUFFT_C2C , cufft . CUFFT_Z2Z ] : plan . fft_func ( plan . handle , int ( x_gpu . gpudata ) , int ( y_gpu . gpudata ) , direction ) else : plan . fft_func ( plan . handle , int ( x_gpu . gpudata ) , int ( y_gpu . gpudata ) ) # Scale the result by dividing it by the number of elements: if scale is not None : func = _get_scale_kernel ( y_gpu . dtype ) func ( y_gpu . dtype . type ( scale ) , y_gpu )