Copyright | [2013..2018] Robert Clifton-Everest Trevor L. McDonell |
---|---|
License | BSD |
Maintainer | Trevor L. McDonell <tmcdonell@cse.unsw.edu.au> |
Stability | experimental |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell98 |
The cuFFT library is an implementation of Fast Fourier Transform (FFT) operations for NVIDIA GPUs.
The FFT is a divide-and-conquer algorithm for efficiently computing discrete Fourier transforms of real- or complex-valued data sets. It is one of the most important and widely used numerical algorithms in computational physics and general signals processing. The cuFFT library provides a simple interface for computing FFTs on a NVIDIA GPU.
To use operations from the cuFFT library, the user must allocate the required arrays in the GPU memory space, fill them with data, call the desired sequence of cuFFT library functions, then copy the results from the GPU memory back to the host.
The cuda package can be used for writing to and retrieving data from the GPU.
- Example
_TODO_
- Additional information
For more information, see the NVIDIA cuFFT documentation:
Synopsis
- data Type
- newtype Handle = Handle CInt
- plan1D :: Int -> Type -> Int -> IO Handle
- plan2D :: Int -> Int -> Type -> IO Handle
- plan3D :: Int -> Int -> Int -> Type -> IO Handle
- planMany :: [Int] -> Maybe ([Int], Int, Int) -> Maybe ([Int], Int, Int) -> Type -> Int -> IO Handle
- destroy :: Handle -> IO ()
- module Foreign.CUDA.FFT.Stream
- data CUFFTException
- module Foreign.CUDA.FFT.Execute
Control
The cuFFT library supports complex- and real-valued transforms. This data type enumerates the kind of transform a plan will execute.
Key:
- R: real (32-bit float)
- D: double (64-bit float)
- C: single-precision complex numbers (32-bit, interleaved)
- Z: double-precision complex numbers (64-bit, interleaved)
A handle used to store and access cuFFT plans.
A handle is created by the FFT planning functions (e.g. plan1D
) and used
during execution of the transforms (e.g. execC2C
).
The handle may be reused, but should be destroy
ed once it is no longer
required, in order to release associated GPU memory and other resources.
:: Int | Size of the transformation |
-> Type | Transformation data type |
-> Int | Number of one-dimensional transforms to configure |
-> IO Handle |
Creates a 1D FFT plan configured for a specified signal size and data type.
The third argument tells cuFFT how many 1D transforms, of size given by the
first argument, to configure. Consider using planMany
for multiple
transforms instead.
http://docs.nvidia.com/cuda/cufft/index.html#function-cufftplan1d
:: Int | The transform size in the x-dimension. This is the slowest changing dimension of a transform (strided in memory) |
-> Int | The transform size in the y-dimension. This is the fastest changing dimension of a transform (contiguous in memory) |
-> Type | Transformation data type |
-> IO Handle |
Creates a 2D FFT plan configuration for a specified signal size and data type.
http://docs.nvidia.com/cuda/cufft/index.html#function-cufftplan2d
:: Int | The transform size in the x-dimension. This is the slowest changing dimension of the transform (strided in memory) |
-> Int | The transform size in the y-dimension. |
-> Int | The transform size in the z-dimension. This is the fastest changing dimension of the transform (contiguous in memory) |
-> Type | Transformation data type |
-> IO Handle |
Creates a 3D FFT plan configuration for a specified signal size and data type.
http://docs.nvidia.com/cuda/cufft/index.html#function-cufftplan3d
:: [Int] | The size of the transform in each dimension, where |
-> Maybe ([Int], Int, Int) | Input data layout. If |
-> Maybe ([Int], Int, Int) | Output data layout. If |
-> Type | Transformation type |
-> Int | Batch size for this transform |
-> IO Handle |
Creates a batched plan configuration for many signals of a specified size and data type in either 1, 2 or 3 dimensions.
This function supports more complicated input and output data layouts. If not
specified (that is, Nothing
is passed for either of the second or third
parameters), contiguous data arrays are assumed.
Data layout configuration consists of three fields, respectively:
- storage dimensions of the input data in memory
- the distance between two successive input elements in the innermost (least significant) dimension
- the distance between the first element of two consecutive signals in a batch of the input data
http://docs.nvidia.com/cuda/cufft/index.html#function-cufftplanmany
destroy :: Handle -> IO () Source #
Release resources associated with the given plan. This function should be called once a plan is no longer needed, to avoid wasting GPU memory.
http://docs.nvidia.com/cuda/cufft/index.html#function-cufftdestroy
module Foreign.CUDA.FFT.Stream
data CUFFTException Source #
Instances
Show CUFFTException Source # | |
Defined in Foreign.CUDA.FFT.Error showsPrec :: Int -> CUFFTException -> ShowS # show :: CUFFTException -> String # showList :: [CUFFTException] -> ShowS # | |
Exception CUFFTException Source # | |
Defined in Foreign.CUDA.FFT.Error |
Operations
module Foreign.CUDA.FFT.Execute