Module Expr Str Import alias identifier Import alias identifier Import alias identifier Import alias identifier Import alias identifier ImportFrom alias ImportFrom alias alias alias alias ImportFrom alias ClassDef bases body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num NameLoad Num NameLoad Num Num NameLoad Num Num NameLoad body If Call AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr TupleLoad NameLoad orelse Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If CompareLtE NameLoad Num body Raise Call NameLoad Str Assign AttributeStore NameLoad attr NameLoad If BoolOpAnd CompareEq NameLoad AttributeLoad NameLoad attr CompareEq NameLoad AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr orelse If BoolOpAnd CompareEq NameLoad AttributeLoad NameLoad attr CompareEq NameLoad AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr orelse If BoolOpAnd CompareEq NameLoad AttributeLoad NameLoad attr CompareEq NameLoad AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr orelse If BoolOpAnd CompareEq NameLoad AttributeLoad NameLoad attr CompareEq NameLoad AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr orelse If BoolOpAnd CompareEq NameLoad AttributeLoad NameLoad attr CompareEq NameLoad AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr orelse If BoolOpAnd CompareEq NameLoad AttributeLoad NameLoad attr CompareEq NameLoad AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr orelse Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr If BoolOpAnd CompareLt NameLoad Num BoolOpOr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad BinOpMod Str NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr If CompareIsNot NameLoad NameLoad body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr If CompareLtE Call NameLoad AttributeLoad NameLoad attr Num body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareNotEq NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body TryExcept body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr handlers ExceptHandler body Pass decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str TryExcept body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index TupleLoad NameLoad AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad Str attr keyword NameLoad Str Assign SubscriptStore AttributeLoad NameLoad attr Index TupleLoad NameLoad AttributeLoad NameLoad attr NameLoad Expr Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad decorator_list Assign AttributeStore NameLoad attr Dict FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str If BoolOpAnd CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr CompareNotIn AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise Call NameLoad Str If BoolOpAnd CompareEq NameLoad AttributeLoad NameLoad attr CompareIn AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Str CompareIn AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Str body Raise Call NameLoad Str If BoolOpAnd CompareEq NameLoad AttributeLoad NameLoad attr CompareIn AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Str CompareIn AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Str body Raise Call NameLoad Str If CompareIn AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr If CompareNotEq NameLoad NameLoad body Expr Call NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str If CompareEq NameLoad NameLoad body Return Call NameLoad NameLoad NameLoad NameLoad AttributeLoad NameLoad attr BinOpDiv AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Return Call NameLoad NameLoad NameLoad NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str If CompareEq NameLoad NameLoad body Return Call NameLoad NameLoad NameLoad NameLoad AttributeLoad NameLoad attr BinOpDiv AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Return Call NameLoad NameLoad NameLoad NameLoad AttributeLoad NameLoad attr decorator_list If CompareEq NameLoad Str body Import alias Expr Call AttributeLoad NameLoad attr
N/A N/A 
PyCUDA-based FFT functions.
 N/A pycuda.driver drv N/A pycuda.gpuarray gpuarray N/A pycuda.elementwise el N/A pycuda.tools tools N/A numpy np N/A cufft cufft CUFFT_COMPATIBILITY_NATIVE CUFFT_COMPATIBILITY_FFTW_PADDING CUFFT_COMPATIBILITY_FFTW_ASYMMETRIC CUFFT_COMPATIBILITY_FFTW_ALL N/A misc Plan N/A N/A N/A 
    CUFFT plan class.

    This class represents an FFT plan for CUFFT.

    Parameters
    ----------
    shape : tuple of ints
        Transform shape. May contain more than 3 elements.
    in_dtype : { numpy.float32, numpy.float64, numpy.complex64, numpy.complex128 }
        Type of input data.
    out_dtype : { numpy.float32, numpy.float64, numpy.complex64, numpy.complex128 }
        Type of output data.
    batch : int
        Number of FFTs to configure in parallel (default is 1).
    stream : pycuda.driver.Stream
        Stream with which to associate the plan. If no stream is specified,
        the default stream is used.
    mode : int
        FFTW compatibility mode.
    inembed : numpy.array with dtype=numpy.int32
        number of elements in each dimension of the input array
    istride : int
        distance between two successive input elements in the least significant
        (innermost) dimension
    idist : int
        distance between the first element of two consective batches in the
        input data
    onembed : numpy.array with dtype=numpy.int32
        number of elements in each dimension of the output array
    ostride : int
        distance between two successive output elements in the least significant
        (innermost) dimension
    odist : int
        distance between the first element of two consective batches in the
        output data
    auto_allocate : bool
        indicates whether the caller intends to allocate and manage the work area
     __init__ N/A N/A self shape in_dtype out_dtype batch stream mode inembed istride idist onembed ostride odist auto_allocate N/A 1 None 1 None 1 0 None 1 0 True N/A N/A N/A N/A np isscalar shape N/A N/A N/A self shape N/A shape N/A N/A N/A self shape shape N/A N/A self in_dtype in_dtype N/A N/A self out_dtype out_dtype N/A N/A batch 0 N/A N/A N/A ValueError batch size must be greater than 0 N/A N/A self batch batch N/A N/A N/A in_dtype N/A np float32 N/A out_dtype N/A np complex64 N/A N/A N/A self fft_type N/A cufft CUFFT_R2C N/A N/A self fft_func N/A cufft cufftExecR2C N/A N/A N/A N/A in_dtype N/A np complex64 N/A out_dtype N/A np float32 N/A N/A N/A self fft_type N/A cufft CUFFT_C2R N/A N/A self fft_func N/A cufft cufftExecC2R N/A N/A N/A N/A in_dtype N/A np complex64 N/A out_dtype N/A np complex64 N/A N/A N/A self fft_type N/A cufft CUFFT_C2C N/A N/A self fft_func N/A cufft cufftExecC2C N/A N/A N/A N/A in_dtype N/A np float64 N/A out_dtype N/A np complex128 N/A N/A N/A self fft_type N/A cufft CUFFT_D2Z N/A N/A self fft_func N/A cufft cufftExecD2Z N/A N/A N/A N/A in_dtype N/A np complex128 N/A out_dtype N/A np float64 N/A N/A N/A self fft_type N/A cufft CUFFT_Z2D N/A N/A self fft_func N/A cufft cufftExecZ2D N/A N/A N/A N/A in_dtype N/A np complex128 N/A out_dtype N/A np complex128 N/A N/A N/A self fft_type N/A cufft CUFFT_Z2Z N/A N/A self fft_func N/A cufft cufftExecZ2Z N/A N/A N/A ValueError unsupported input/output type combination N/A capability N/A N/A misc get_compute_capability N/A N/A misc get_current_device N/A N/A N/A capability 1.3 N/A N/A N/A misc isdoubletype in_dtype N/A N/A misc isdoubletype out_dtype N/A N/A N/A RuntimeError N/A double precision requires compute capability >= 1.3 (you have %g) capability N/A N/A inembed None N/A N/A inembed N/A N/A inembed ctypes data N/A N/A onembed None N/A N/A onembed N/A N/A onembed ctypes data N/A N/A N/A len N/A self shape 0 N/A N/A N/A ValueError invalid transform size N/A n N/A N/A np asarray N/A self shape N/A np int32 N/A N/A self handle N/A N/A cufft cufftCreate N/A N/A N/A cufft cufftSetCompatibilityMode N/A self handle mode N/A N/A N/A cufft cufftSetAutoAllocation N/A self handle auto_allocate N/A N/A self worksize N/A N/A cufft cufftMakePlanMany N/A self handle N/A len N/A self shape N/A N/A n ctypes data inembed istride idist onembed ostride odist N/A self fft_type N/A self batch N/A N/A stream None N/A N/A N/A N/A cufft cufftSetStream N/A self handle N/A stream handle N/A set_work_area N/A N/A self work_area N/A N/A N/A 
        Associate a caller-managed work area with the plan.

        Parameters
        ----------
        work_area : pycuda.gpuarray.GPUArray
         N/A N/A N/A cufft cufftSetWorkArea N/A self handle N/A int N/A work_area gpudata N/A __del__ N/A N/A self N/A N/A N/A N/A N/A N/A N/A cufft cufftDestroy N/A self handle N/A N/A N/A N/A N/A N/A _scale_inplace N/A N/A a x_gpu N/A N/A N/A 
    Scale an array by a specified value in-place.
     N/A N/A N/A func N/A N/A _scale_inplace cache N/A N/A a N/A x_gpu dtype N/A N/A N/A KeyError N/A N/A ctype N/A N/A tools dtype_to_ctype N/A x_gpu dtype N/A func N/A N/A el ElementwiseKernel N/A N/A {ctype} a, {ctype} *x format ctype ctype x[i] /= a N/A N/A N/A _scale_inplace cache N/A N/A a N/A x_gpu dtype func N/A N/A func N/A N/A N/A x_gpu dtype type a x_gpu N/A N/A N/A _scale_inplace cache N/A _fft N/A N/A x_gpu y_gpu plan direction scale N/A None N/A N/A 
    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.

     N/A N/A N/A N/A x_gpu gpudata N/A y_gpu gpudata N/A N/A plan fft_type N/A N/A cufft CUFFT_C2C N/A cufft CUFFT_Z2Z N/A N/A N/A ValueError can only compute in-place transform of complex data N/A N/A N/A direction N/A cufft CUFFT_FORWARD N/A N/A plan in_dtype N/A N/A np sctypes N/A complex N/A N/A plan out_dtype N/A N/A np sctypes N/A float N/A N/A N/A ValueError cannot compute forward complex -> real transform N/A N/A N/A direction N/A cufft CUFFT_INVERSE N/A N/A plan in_dtype N/A N/A np sctypes N/A float N/A N/A plan out_dtype N/A N/A np sctypes N/A complex N/A N/A N/A ValueError cannot compute inverse real -> complex transform N/A N/A N/A plan fft_type N/A N/A cufft CUFFT_C2C N/A cufft CUFFT_Z2Z N/A N/A N/A N/A plan fft_func N/A plan handle N/A int N/A x_gpu gpudata N/A int N/A y_gpu gpudata direction N/A N/A N/A N/A plan fft_func N/A plan handle N/A int N/A x_gpu gpudata N/A int N/A y_gpu gpudata N/A N/A scale None N/A N/A N/A _scale_inplace scale y_gpu N/A fft N/A N/A x_gpu y_gpu plan scale N/A False N/A N/A 
    Fast Fourier Transform.

    Compute the FFT of some data in device memory using the
    specified plan.

    Parameters
    ----------
    x_gpu : pycuda.gpuarray.GPUArray
        Input array.
    y_gpu : pycuda.gpuarray.GPUArray
        FFT of input array.
    plan : Plan
        FFT plan.
    scale : bool, optional
        If True, scale the computed FFT by the number of elements in
        the input array.

    Examples
    --------
    >>> import pycuda.autoinit
    >>> import pycuda.gpuarray as gpuarray
    >>> import numpy as np
    >>> N = 128
    >>> x = np.asarray(np.random.rand(N), np.float32)
    >>> xf = np.fft.fft(x)
    >>> x_gpu = gpuarray.to_gpu(x)
    >>> xf_gpu = gpuarray.empty(N/2+1, np.complex64)
    >>> plan = Plan(x.shape, np.float32, np.complex64)
    >>> fft(x_gpu, xf_gpu, plan)
    >>> np.allclose(xf[0:N/2+1], xf_gpu.get(), atol=1e-6)
    True

    Returns
    -------
    y_gpu : pycuda.gpuarray.GPUArray
        Computed FFT.

    Notes
    -----
    For real to complex transformations, this function computes
    N/2+1 non-redundant coefficients of a length-N input signal.

     N/A N/A scale True N/A N/A N/A _fft x_gpu y_gpu plan N/A cufft CUFFT_FORWARD N/A N/A x_gpu size N/A plan batch N/A N/A N/A _fft x_gpu y_gpu plan N/A cufft CUFFT_FORWARD N/A ifft N/A N/A x_gpu y_gpu plan scale N/A False N/A N/A 
    Inverse Fast Fourier Transform.

    Compute the inverse FFT of some data in device memory using the
    specified plan.

    Parameters
    ----------
    x_gpu : pycuda.gpuarray.GPUArray
        Input array.
    y_gpu : pycuda.gpuarray.GPUArray
        Inverse FFT of input array.
    plan : Plan
        FFT plan.
    scale : bool, optional
        If True, scale the computed inverse FFT by the number of
        elements in the output array.

    Examples
    --------
    >>> import pycuda.autoinit
    >>> import pycuda.gpuarray as gpuarray
    >>> import numpy as np
    >>> N = 128
    >>> x = np.asarray(np.random.rand(N), np.float32)
    >>> xf = np.asarray(np.fft.fft(x), np.complex64)
    >>> xf_gpu = gpuarray.to_gpu(xf[0:N/2+1])
    >>> x_gpu = gpuarray.empty(N, np.float32)
    >>> plan = Plan(N, np.complex64, np.float32)
    >>> ifft(xf_gpu, x_gpu, plan, True)
    >>> np.allclose(x, x_gpu.get(), atol=1e-6)
    True

    Notes
    -----
    For complex to real transformations, this function assumes the
    input contains N/2+1 non-redundant FFT coefficents of a signal of
    length N.

     N/A N/A scale True N/A N/A N/A _fft x_gpu y_gpu plan N/A cufft CUFFT_INVERSE N/A N/A y_gpu size N/A plan batch N/A N/A N/A _fft x_gpu y_gpu plan N/A cufft CUFFT_INVERSE N/A N/A N/A __name__ __main__ N/A N/A doctest N/A N/A N/A doctest testmod