Class CudaFFTNativeMethods
C# wrapper for the NVIDIA CUFFT API (--> cufft.h)
Inheritance
Inherited Members
Namespace: ManagedCuda.CudaFFT
Assembly: CudaFFT.dll
Syntax
public static class CudaFFTNativeMethods
Methods
cufftCreate(ref cufftHandle)
Creates only an opaque handle, and allocates small data structures on the host. The cufftMakePlan*() calls actually do the plan generation. It is recommended that cufftSet*() calls, such as cufftSetCompatibilityMode(), that may require a plan to be broken down and re-generated, should be made after cufftCreate() and before one of the cufftMakePlan*() calls.
Declaration
public static cufftResult cufftCreate(ref cufftHandle cufftHandle)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | cufftHandle | Pointer to a cufftHandle object |
Returns
Type | Description |
---|---|
cufftResult | cufftResult Error Codes: Success, AllocFailed, InvalidPlan, InvalidValue, InternalError, SetupFailed, InvalidSize, |
cufftDestroy(cufftHandle)
Frees all GPU resources associated with a CUFFT plan and destroys the internal plan data structure. This function should be called once a plan is no longer needed to avoid wasting GPU memory.
Declaration
public static cufftResult cufftDestroy(cufftHandle plan)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | plan | The cufftHandle object of the plan to be destroyed. |
Returns
Type | Description |
---|---|
cufftResult |
cufftEstimate1d(Int32, cufftType, Int32, ref SizeT)
During plan execution, CUFFT requires a work area for temporary storage of intermediate results. This call returns an estimate for the size of the work area required, given the specified parameters, and assuming default plan settings. Note that changing some plan settings, such as compatibility mode, may alter the size required for the work area.
Declaration
public static cufftResult cufftEstimate1d(int nx, cufftType type, int batch, ref SizeT workSize)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nx | The transform size (e.g. 256 for a 256-point FFT) |
cufftType | type | The transform data type (e.g., CUFFT_C2C for single precision complex to complex) |
System.Int32 | batch | Number of transforms of size nx |
SizeT | workSize | Pointer to the size of the work space |
Returns
Type | Description |
---|---|
cufftResult |
cufftEstimate2d(Int32, Int32, cufftType, ref SizeT)
During plan execution, CUFFT requires a work area for temporary storage of intermediate results. This call returns an estimate for the size of the work area required, given the specified parameters, and assuming default plan settings. Note that changing some plan settings, such as compatibility mode, may alter the size required for the workarea.
Declaration
public static cufftResult cufftEstimate2d(int nx, int ny, cufftType type, ref SizeT workSize)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nx | The transform size in the x dimension (number of rows) |
System.Int32 | ny | The transform size in the y dimension (number of columns) |
cufftType | type | The transform data type (e.g., CUFFT_C2R for single precision complex to real) |
SizeT | workSize | Pointer to the size of the work space |
Returns
Type | Description |
---|---|
cufftResult |
cufftEstimate3d(Int32, Int32, Int32, cufftType, ref SizeT)
During plan execution, CUFFT requires a work area for temporary storage of intermediate results. This call returns an estimate for the size of the work area required, given the specified parameters, and assuming default plan settings. Note that changing some plan settings, such as compatibility mode, may alter the size required for the workarea.
Declaration
public static cufftResult cufftEstimate3d(int nx, int ny, int nz, cufftType type, ref SizeT workSize)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nx | The transform size in the x dimension |
System.Int32 | ny | The transform size in the y dimension |
System.Int32 | nz | The transform size in the z dimension |
cufftType | type | The transform data type (e.g., CUFFT_R2C for single precision real to complex) |
SizeT | workSize | Pointer to the size of the work space |
Returns
Type | Description |
---|---|
cufftResult |
cufftEstimateMany(Int32, Int32[], Int32[], Int32, Int32, Int32[], Int32, Int32, cufftType, Int32, ref SizeT)
During plan execution, CUFFT requires a work area for temporary storage of intermediate results. This call returns an estimate for the size of the work area required, given the specified parameters, and assuming default plan settings. Note that changing some plan settings, such as compatibility mode, may alter the size required for the work area.
The cufftPlanMany() API supports more complicated input and output data layouts via the advanced data layout parameters: inembed, istride, idist, onembed, ostride, and odist.
All arrays are assumed to be in CPU memory.
Declaration
public static cufftResult cufftEstimateMany(int rank, int[] n, int[] inembed, int istride, int idist, int[] onembed, int ostride, int odist, cufftType type, int batch, ref SizeT workSize)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rank | Dimensionality of the transform (1, 2, or 3) |
System.Int32[] | n | Array of size rank, describing the size of each dimension |
System.Int32[] | inembed | Pointer of size rank that indicates the storage dimensions of the input data in memory. If set to NULL all other advanced data layout parameters are ignored. |
System.Int32 | istride | Indicates the distance between two successive input elements in the least significant (i.e., innermost) dimension |
System.Int32 | idist | Indicates the distance between the first element of two consecutive signals in a batch of the input data |
System.Int32[] | onembed | Pointer of size rank that indicates the storage dimensions of the output data in memory. If set to NULL all other advanced data layout parameters are ignored. |
System.Int32 | ostride | Indicates the distance between two successive output elements in the output array in the least significant (i.e., innermost) dimension |
System.Int32 | odist | Indicates the distance between the first element of two consecutive signals in a batch of the output data |
cufftType | type | The transform data type (e.g., CUFFT_R2C for single precision real to complex) |
System.Int32 | batch | Batch size for this transform |
SizeT | workSize | Pointer to the size of the work space |
Returns
Type | Description |
---|---|
cufftResult |
cufftExecC2C(cufftHandle, CUdeviceptr, CUdeviceptr, TransformDirection)
Executes a CUFFT single‐precision complex‐to‐complex transform plan as specified by direction. CUFFT uses as input data the GPU memory pointed to by the idata parameter. This function stores the Fourier coefficients in the odata array. If idata and odata are the same, this method does an in‐place transform.
Declaration
public static cufftResult cufftExecC2C(cufftHandle plan, CUdeviceptr idata, CUdeviceptr odata, TransformDirection direction)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | plan | The cufftHandle object of the plan to be destroyed. |
CUdeviceptr | idata | cuFloatComplex: Pointer to the single-precision complex input data (in GPU memory) to transform |
CUdeviceptr | odata | cuFloatComplex: Pointer to the single-precision complex output data (in GPU memory) |
TransformDirection | direction | The transform direction: Forward or Inverse |
Returns
Type | Description |
---|---|
cufftResult | cufftResult Error Codes: SetupFailed, InternalError, InvalidPlan, Success |
cufftExecC2R(cufftHandle, CUdeviceptr, CUdeviceptr)
Executes a CUFFT single‐precision complex‐to‐real (implicitly inverse) transform plan. CUFFT uses as input data the GPU memory pointed to by the idata parameter. The input array holds only the nonredundant complex Fourier coefficients. This function stores the real output values in the odata array. If idata and odata are the same, this method does an in‐place transform. (See “CUFFT Transform Types” on page 4 for details on real data FFTs.)
Declaration
public static cufftResult cufftExecC2R(cufftHandle plan, CUdeviceptr idata, CUdeviceptr odata)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | plan | The cufftHandle object of the plan to be destroyed. |
CUdeviceptr | idata | cuFloatComplex: Pointer to the single-precision complex input data (in GPU memory) to transform |
CUdeviceptr | odata | cuFloatReal: Pointer to the single-precision real output data (in GPU memory) |
Returns
Type | Description |
---|---|
cufftResult | cufftResult Error Codes: SetupFailed, InvalidPlan, InvalidValue, ExecFailed, Success |
cufftExecD2Z(cufftHandle, CUdeviceptr, CUdeviceptr)
Executes a CUFFT double‐precision real‐to‐complex (implicitly
forward) transform plan. CUFFT uses as input data the GPU memory
pointed to by the idata
parameter. This function stores the nonredundant
Fourier coefficients in the odata
array. If idata
and odata
are the same, this method does an in‐place transform (See “CUFFT
Transform Types” on page 4 for details on real data FFTs.)
Declaration
public static cufftResult cufftExecD2Z(cufftHandle plan, CUdeviceptr idata, CUdeviceptr odata)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | plan | The cufftHandle object of the plan to be destroyed. |
CUdeviceptr | idata | cuDoubleReal: Pointer to the double-precision real input data (in GPU memory) to transform |
CUdeviceptr | odata | cuDoubleComplex: Pointer to the double-precision complex output data (in GPU memory) |
Returns
Type | Description |
---|---|
cufftResult | cufftResult Error Codes: SetupFailed, InvalidPlan, InvalidValue, ExecFailed, Success |
cufftExecR2C(cufftHandle, CUdeviceptr, CUdeviceptr)
executes a CUFFT single‐precision real‐to‐complex (implicitly
forward) transform plan. CUFFT uses as input data the GPU memory
pointed to by the idata
parameter. This function stores the nonredundant
Fourier coefficients in the odata
array. If idata
and odata
are the same, this method does an in‐place transform (See “CUFFT
Transform Types” on page 4 for details on real data FFTs.)
Declaration
public static cufftResult cufftExecR2C(cufftHandle plan, CUdeviceptr idata, CUdeviceptr odata)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | plan | The cufftHandle object of the plan to be destroyed. |
CUdeviceptr | idata | cuFloatReal: Pointer to the single-precision real input data (in GPU memory) to transform |
CUdeviceptr | odata | cuFloatComplex: Pointer to the single-precision complex output data (in GPU memory) |
Returns
Type | Description |
---|---|
cufftResult | cufftResult Error Codes: SetupFailed, InvalidPlan, InvalidValue, ExecFailed, Success |
cufftExecZ2D(cufftHandle, CUdeviceptr, CUdeviceptr)
Executes a CUFFT double‐precision complex‐to‐real (implicitly
inverse) transform plan. CUFFT uses as input data the GPU memory
pointed to by the idata
parameter. The input array holds only the
non‐redundant complex Fourier coefficients. This function stores the
real output values in the odata
array. If idata
and odata
are the same,
this method does an in‐place transform. (See “CUFFT Transform
Types” on page 4 for details on real data FFTs.)
Declaration
public static cufftResult cufftExecZ2D(cufftHandle plan, CUdeviceptr idata, CUdeviceptr odata)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | plan | The cufftHandle object of the plan to be destroyed. |
CUdeviceptr | idata | cuDoubleComplex: Pointer to the double-precision complex input data (in GPU memory) to transform |
CUdeviceptr | odata | cuDoubleReal: Pointer to the double-precision real output data (in GPU memory) |
Returns
Type | Description |
---|---|
cufftResult | cufftResult Error Codes: SetupFailed, InvalidPlan, InvalidValue, ExecFailed, Success |
cufftExecZ2Z(cufftHandle, CUdeviceptr, CUdeviceptr, TransformDirection)
Executes a CUFFT double‐precision complex‐to‐complex transform
plan as specified by direction. CUFFT uses as input data the GPU
memory pointed to by the idata
parameter. This function stores the
Fourier coefficients in the odata
array. If idata
and odata
are the
same, this method does an in‐place transform.
Declaration
public static cufftResult cufftExecZ2Z(cufftHandle plan, CUdeviceptr idata, CUdeviceptr odata, TransformDirection direction)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | plan | The cufftHandle object of the plan to be destroyed. |
CUdeviceptr | idata | cuDoubleComplex: Pointer to the double-precision complex input data (in GPU memory) to transform |
CUdeviceptr | odata | cuDoubleComplex: Pointer to the double-precision complex output data (in GPU memory) |
TransformDirection | direction | The transform direction: Forward or Inverse |
Returns
Type | Description |
---|---|
cufftResult | cufftResult Error Codes: SetupFailed, InvalidPlan, InvalidValue, ExecFailed, Success |
cufftGetSize(cufftHandle, ref SizeT)
Once plan generation has been done, either with the original API or the extensible API, this call returns the actual size of the work area required to support the plan. Callers who choose to manage work area allocation within their application must use this call after plan generation, and after any cufftSet*() calls subsequent to plan generation, if those calls might alter the required work space size.
Declaration
public static cufftResult cufftGetSize(cufftHandle handle, ref SizeT workSize)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | handle | cufftHandle object |
SizeT | workSize | Pointer to the size of the work space |
Returns
Type | Description |
---|---|
cufftResult |
cufftGetSize1d(cufftHandle, Int32, cufftType, Int32, ref SizeT)
This call gives a more accurate estimate of the work area size required for a plan than cufftEstimate1d(), given the specified parameters, and taking into account any plan settings that may have been made.
Declaration
public static cufftResult cufftGetSize1d(cufftHandle handle, int nx, cufftType type, int batch, ref SizeT workSize)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | handle | cufftHandle object |
System.Int32 | nx | The transform size (e.g. 256 for a 256-point FFT) |
cufftType | type | The transform data type (e.g., CUFFT_C2C for single precision complex to complex) |
System.Int32 | batch | Number of transforms of size nx |
SizeT | workSize | Pointer to the size of the work space |
Returns
Type | Description |
---|---|
cufftResult |
cufftGetSize2d(cufftHandle, Int32, Int32, cufftType, ref SizeT)
This call gives a more accurate estimate of the work area size required for a plan than cufftEstimate2d(), given the specified parameters, and taking into account any plan settings that may have been made.
Declaration
public static cufftResult cufftGetSize2d(cufftHandle handle, int nx, int ny, cufftType type, ref SizeT workSize)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | handle | cufftHandle object |
System.Int32 | nx | The transform size in the x dimension (number of rows) |
System.Int32 | ny | The transform size in the y dimension (number of columns) |
cufftType | type | The transform data type (e.g., CUFFT_C2R for single precision complex to real) |
SizeT | workSize | Pointer to the size of the work space |
Returns
Type | Description |
---|---|
cufftResult |
cufftGetSize3d(cufftHandle, Int32, Int32, Int32, cufftType, ref SizeT)
This call gives a more accurate estimate of the work area size required for a plan than cufftEstimate3d(), given the specified parameters, and taking into account any plan settings that may have been made.
Declaration
public static cufftResult cufftGetSize3d(cufftHandle handle, int nx, int ny, int nz, cufftType type, ref SizeT workSize)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | handle | cufftHandle object |
System.Int32 | nx | The transform size in the x dimension |
System.Int32 | ny | The transform size in the y dimension |
System.Int32 | nz | The transform size in the z dimension |
cufftType | type | The transform data type (e.g., CUFFT_R2C for single precision real to complex) |
SizeT | workSize | Pointer to the size of the work space |
Returns
Type | Description |
---|---|
cufftResult |
cufftGetSizeMany(cufftHandle, Int32, Int32[], Int32[], Int32, Int32, Int32[], Int32, Int32, cufftType, Int32, ref SizeT)
This call gives a more accurate estimate of the work area size required for a plan than cufftEstimateSizeMany(), given the specified parameters, and taking into account any plan settings that may have been made.
The batch input parameter tells CUFFT how many transforms to configure. With this function, batched plans of 1, 2, or 3 dimensions may be created.
The cufftPlanMany() API supports more complicated input and output data layouts via the advanced data layout parameters: inembed, istride, idist, onembed, ostride, and odist.
All arrays are assumed to be in CPU memory
Declaration
public static cufftResult cufftGetSizeMany(cufftHandle handle, int rank, int[] n, int[] inembed, int istride, int idist, int[] onembed, int ostride, int odist, cufftType type, int batch, ref SizeT workArea)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | handle | cufftHandle object |
System.Int32 | rank | Dimensionality of the transform (1, 2, or 3) |
System.Int32[] | n | Array of size rank, describing the size of each dimension |
System.Int32[] | inembed | Pointer of size rank that indicates the storage dimensions of the input data in memory. If set to NULL all other advanced data layout parameters are ignored. |
System.Int32 | istride | Indicates the distance between two successive input elements in the least significant (i.e., innermost) dimension |
System.Int32 | idist | Indicates the distance between the first element of two consecutive signals in a batch of the input data |
System.Int32[] | onembed | Pointer of size rank that indicates the storage dimensions of the output data in memory. If set to NULL all other advanced data layout parameters are ignored. |
System.Int32 | ostride | Indicates the distance between two successive output elements in the output array in the least significant (i.e., innermost) dimension |
System.Int32 | odist | Indicates the distance between the first element of two consecutive signals in a batch of the output data |
cufftType | type | The transform data type (e.g., CUFFT_R2C for single precision real to complex) |
System.Int32 | batch | Batch size for this transform |
SizeT | workArea | Pointer to the size of the work space |
Returns
Type | Description |
---|---|
cufftResult |
cufftGetSizeMany64(cufftHandle, Int64, Int64[], Int64[], Int64, Int64, Int64[], Int64, Int64, cufftType, Int64, ref SizeT)
This call gives a more accurate estimate of the work area size required for a plan than cufftEstimateSizeMany(), given the specified parameters, and taking into account any plan settings that may have been made.
The batch input parameter tells CUFFT how many transforms to configure. With this function, batched plans of 1, 2, or 3 dimensions may be created.
The cufftPlanMany() API supports more complicated input and output data layouts via the advanced data layout parameters: inembed, istride, idist, onembed, ostride, and odist.
All arrays are assumed to be in CPU memory
Declaration
public static cufftResult cufftGetSizeMany64(cufftHandle plan, long rank, long[] n, long[] inembed, long istride, long idist, long[] onembed, long ostride, long odist, cufftType type, long batch, ref SizeT workArea)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | plan | cufftHandle object |
System.Int64 | rank | Dimensionality of the transform (1, 2, or 3) |
System.Int64[] | n | Array of size rank, describing the size of each dimension |
System.Int64[] | inembed | Pointer of size rank that indicates the storage dimensions of the input data in memory. If set to NULL all other advanced data layout parameters are ignored. |
System.Int64 | istride | Indicates the distance between two successive input elements in the least significant (i.e., innermost) dimension |
System.Int64 | idist | Indicates the distance between the first element of two consecutive signals in a batch of the input data |
System.Int64[] | onembed | Pointer of size rank that indicates the storage dimensions of the output data in memory. If set to NULL all other advanced data layout parameters are ignored. |
System.Int64 | ostride | Indicates the distance between two successive output elements in the output array in the least significant (i.e., innermost) dimension |
System.Int64 | odist | Indicates the distance between the first element of two consecutive signals in a batch of the output data |
cufftType | type | The transform data type (e.g., CUFFT_R2C for single precision real to complex) |
System.Int64 | batch | Batch size for this transform |
SizeT | workArea | Pointer to the size of the work space |
Returns
Type | Description |
---|---|
cufftResult |
cufftMakePlan1d(cufftHandle, Int32, cufftType, Int32, ref SizeT)
Following a call to cufftCreate() makes a 1D FFT plan configuration for a specified signal size and data type. The batch input parameter tells CUFFT how many 1D transforms to configure.
Declaration
public static cufftResult cufftMakePlan1d(cufftHandle plan, int nx, cufftType type, int batch, ref SizeT workSize)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | plan | cufftHandle object |
System.Int32 | nx | The transform size (e.g. 256 for a 256-point FFT) |
cufftType | type | The transform data type (e.g., CUFFT_C2C for single precision complex to complex) |
System.Int32 | batch | Number of transforms of size nx |
SizeT | workSize |
Returns
Type | Description |
---|---|
cufftResult |
cufftMakePlan2d(cufftHandle, Int32, Int32, cufftType, ref SizeT)
Following a call to cufftCreate() makes a 2D FFT plan configuration according to specified signal sizes and data type.
Declaration
public static cufftResult cufftMakePlan2d(cufftHandle plan, int nx, int ny, cufftType type, ref SizeT workSize)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | plan | cufftHandle object |
System.Int32 | nx | The transform size in the x dimension (number of rows) |
System.Int32 | ny | The transform size in the y dimension (number of columns) |
cufftType | type | The transform data type (e.g., CUFFT_C2R for single precision complex to real) |
SizeT | workSize |
Returns
Type | Description |
---|---|
cufftResult |
cufftMakePlan3d(cufftHandle, Int32, Int32, Int32, cufftType, ref SizeT)
Following a call to cufftCreate() makes a 3D FFT plan configuration according to specified signal sizes and data type. This function is the same as cufftPlan2d() except that it takes a third size parameter nz.
Declaration
public static cufftResult cufftMakePlan3d(cufftHandle plan, int nx, int ny, int nz, cufftType type, ref SizeT workSize)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | plan | cufftHandle object |
System.Int32 | nx | The transform size in the x dimension |
System.Int32 | ny | The transform size in the y dimension |
System.Int32 | nz | The transform size in the z dimension |
cufftType | type | The transform data type (e.g., CUFFT_R2C for single precision real to complex) |
SizeT | workSize |
Returns
Type | Description |
---|---|
cufftResult |
cufftMakePlanMany(cufftHandle, Int32, Int32[], Int32[], Int32, Int32, Int32[], Int32, Int32, cufftType, Int32, ref SizeT)
Following a call to cufftCreate() makes a FFT plan configuration of dimension rank, with sizes specified in the array n. The batch input parameter tells CUFFT how many transforms to configure. With this function, batched plans of 1, 2, or 3 dimensions may be created.
The cufftPlanMany() API supports more complicated input and output data layouts via the advanced data layout parameters: inembed, istride, idist, onembed, ostride, and odist.
All arrays are assumed to be in CPU memory.
Declaration
public static cufftResult cufftMakePlanMany(cufftHandle plan, int rank, int[] n, int[] inembed, int istride, int idist, int[] onembed, int ostride, int odist, cufftType type, int batch, ref SizeT workSize)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | plan | cufftHandle object |
System.Int32 | rank | Dimensionality of the transform (1, 2, or 3) |
System.Int32[] | n | Array of size rank, describing the size of each dimension |
System.Int32[] | inembed | Pointer of size rank that indicates the storage dimensions of the input data in memory. If set to NULL all other advanced data layout parameters are ignored. |
System.Int32 | istride | Indicates the distance between two successive input elements in the least significant (i.e., innermost) dimension |
System.Int32 | idist | Indicates the distance between the first element of two consecutive signals in a batch of the input data |
System.Int32[] | onembed | Pointer of size rank that indicates the storage dimensions of the output data in memory. If set to NULL all other advanced data layout parameters are ignored. |
System.Int32 | ostride | Indicates the distance between two successive output elements in the output array in the least significant (i.e., innermost) dimension |
System.Int32 | odist | Indicates the distance between the first element of two consecutive signals in a batch of the output data |
cufftType | type | The transform data type (e.g., CUFFT_R2C for single precision real to complex) |
System.Int32 | batch | Batch size for this transform |
SizeT | workSize |
Returns
Type | Description |
---|---|
cufftResult |
cufftMakePlanMany64(cufftHandle, Int32, Int64[], Int64[], Int64, Int64, Int64[], Int64, Int64, cufftType, Int64, ref SizeT)
Following a call to cufftCreate() makes a FFT plan configuration of dimension rank, with sizes specified in the array n. The batch input parameter tells CUFFT how many transforms to configure. With this function, batched plans of 1, 2, or 3 dimensions may be created.
The cufftPlanMany() API supports more complicated input and output data layouts via the advanced data layout parameters: inembed, istride, idist, onembed, ostride, and odist.
All arrays are assumed to be in CPU memory.
Declaration
public static cufftResult cufftMakePlanMany64(cufftHandle plan, int rank, long[] n, long[] inembed, long istride, long idist, long[] onembed, long ostride, long odist, cufftType type, long batch, ref SizeT workSize)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | plan | cufftHandle object |
System.Int32 | rank | Dimensionality of the transform (1, 2, or 3) |
System.Int64[] | n | Array of size rank, describing the size of each dimension |
System.Int64[] | inembed | Pointer of size rank that indicates the storage dimensions of the input data in memory. If set to NULL all other advanced data layout parameters are ignored. |
System.Int64 | istride | Indicates the distance between two successive input elements in the least significant (i.e., innermost) dimension |
System.Int64 | idist | Indicates the distance between the first element of two consecutive signals in a batch of the input data |
System.Int64[] | onembed | Pointer of size rank that indicates the storage dimensions of the output data in memory. If set to NULL all other advanced data layout parameters are ignored. |
System.Int64 | ostride | Indicates the distance between two successive output elements in the output array in the least significant (i.e., innermost) dimension |
System.Int64 | odist | Indicates the distance between the first element of two consecutive signals in a batch of the output data |
cufftType | type | The transform data type (e.g., CUFFT_R2C for single precision real to complex) |
System.Int64 | batch | Batch size for this transform |
SizeT | workSize |
Returns
Type | Description |
---|---|
cufftResult |
cufftPlan1d(ref cufftHandle, Int32, cufftType, Int32)
Creates a 1D FFT plan configuration for a specified signal size and data
type. The batch
input parameter tells CUFFT how many 1D
transforms to configure.
Declaration
public static cufftResult cufftPlan1d(ref cufftHandle plan, int nx, cufftType type, int batch)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | plan | Pointer to a cufftHandle object |
System.Int32 | nx | The transform size (e.g., 256 for a 256-point FFT) |
cufftType | type | The transform data type (e.g., C2C for complex to complex) |
System.Int32 | batch | Number of transforms of size nx |
Returns
Type | Description |
---|---|
cufftResult | cufftResult Error Codes: Success, AllocFailed, InvalidType, InvalidValue, InternalError, SetupFailed, InvalidSize, |
cufftPlan2d(ref cufftHandle, Int32, Int32, cufftType)
Creates a 2D FFT plan configuration according to specified signal sizes
and data type. This function is the same as cufftPlan1d(ref cufftHandle, Int32, cufftType, Int32) except that
it takes a second size parameter, ny
, and does not support batching.
Declaration
public static cufftResult cufftPlan2d(ref cufftHandle plan, int nx, int ny, cufftType type)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | plan | Pointer to a cufftHandle object |
System.Int32 | nx | The transform size in the X dimension (number of rows) |
System.Int32 | ny | The transform size in the Y dimension (number of columns) |
cufftType | type | The transform data type (e.g., C2R for complex to real) |
Returns
Type | Description |
---|---|
cufftResult | cufftResult Error Codes: Success, AllocFailed, InvalidType, InvalidValue, InternalError, SetupFailed, InvalidSize, |
cufftPlan3d(ref cufftHandle, Int32, Int32, Int32, cufftType)
Creates a 3D FFT plan configuration according to specified signal sizes
and data type. This function is the same as cufftPlan2d(ref cufftHandle, Int32, Int32, cufftType) except that
it takes a third size parameter nz
.
Declaration
public static cufftResult cufftPlan3d(ref cufftHandle plan, int nx, int ny, int nz, cufftType type)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | plan | Pointer to a cufftHandle object |
System.Int32 | nx | The transform size in the X dimension |
System.Int32 | ny | The transform size in the Y dimension |
System.Int32 | nz | The transform size in the Z dimension |
cufftType | type | The transform data type (e.g., R2C for real to complex) |
Returns
Type | Description |
---|---|
cufftResult | cufftResult Error Codes: Success, AllocFailed, InvalidType, InvalidValue, InternalError, SetupFailed, InvalidSize, |
cufftPlanMany(ref cufftHandle, Int32, Int32[], Int32[], Int32, Int32, Int32[], Int32, Int32, cufftType, Int32)
Creates a FFT plan configuration of dimension rank, with sizes
specified in the array n
. The batch
input parameter tells CUFFT how
many transforms to configure in parallel. With this function, batched
plans of any dimension may be created.
Input parameters inembed
, istride
, and idist
and output
parameters onembed
, ostride
, and odist
will allow setup of noncontiguous
input data in a future version (Beta status in version 4.0). Note that for CUFFT 3.0,
these parameters are ignored and the layout of batched data must be
side‐by‐side and not interleaved.
Declaration
public static cufftResult cufftPlanMany(ref cufftHandle plan, int rank, int[] n, int[] inembed, int istride, int idist, int[] onembed, int ostride, int odist, cufftType type, int batch)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | plan | Pointer to a cufftHandle object |
System.Int32 | rank | Dimensionality of the transform (1, 2, or 3) |
System.Int32[] | n | An array of size rank, describing the size of each dimension |
System.Int32[] | inembed | Pointer of size rank that indicates the storage dimensions of the input data in memory |
System.Int32 | istride | Defines the distance between two successive input elements in the least significant (i.e., innermost) dimension |
System.Int32 | idist | Indicates the distance between the first element of two consecutive batches in the input data |
System.Int32[] | onembed | Pointer of size rank that indicates the storage dimensions of the output data in memory |
System.Int32 | ostride | Defines the distance between two successive output elements in the output array in the least significant (i.e., innermost) dimension |
System.Int32 | odist | Indicates the distance between the first element of two consecutive batches in the output data |
cufftType | type | Transform data type (e.g., C2C, as per other CUFFT calls) |
System.Int32 | batch | Batch size for this transform |
Returns
Type | Description |
---|---|
cufftResult | cufftResult Error Codes: Success, AllocFailed, InvalidType, InvalidValue, InternalError, SetupFailed, InvalidSize, |
cufftSetAutoAllocation(cufftHandle, Int32)
cufftSetAutoAllocation() indicates that the caller intends to allocate and manage work areas for plans that have been generated. CUFFT default behavior is to allocate the work area at plan generation time. If cufftSetAutoAllocation() has been called with autoAllocate set to "false" prior to one of the cufftMakePlan*() calls, CUFFT does not allocate the work area. This is the preferred sequence for callers wishing to manage work area allocation.
Declaration
public static cufftResult cufftSetAutoAllocation(cufftHandle plan, int autoAllocate)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | plan | cufftHandle object |
System.Int32 | autoAllocate | Boolean to indicate whether to allocate work area. |
Returns
Type | Description |
---|---|
cufftResult |
cufftSetCompatibilityMode(cufftHandle, Compatibility)
configures the layout of CUFFT output in FFTW‐compatible modes. When FFTW compatibility is desired, it can be configured for padding only, for asymmetric complex inputs only, or to be fully compatible.
Declaration
public static cufftResult cufftSetCompatibilityMode(cufftHandle plan, Compatibility mode)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | plan | The cufftHandle object of the plan to be destroyed. |
Compatibility | mode | The Compatibility option to be used |
Returns
Type | Description |
---|---|
cufftResult | cufftResult Error Codes: SetupFailed, InvalidPlan, Success |
cufftSetStream(cufftHandle, CUstream)
Associates a CUDA stream with a CUFFT plan. All kernel launches made during plan execution are now done through the associated stream, enabling overlap with activity in other streams (for example, data copying). The association remains until the plan is destroyed or the stream is changed with another call to cufftSetStream().
Declaration
public static cufftResult cufftSetStream(cufftHandle plan, CUstream stream)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | plan | The cufftHandle object of the plan to be destroyed. |
CUstream | stream | A valid CUDA stream created with cudaStreamCreate() (or 0 for the default stream) |
Returns
Type | Description |
---|---|
cufftResult | cufftResult Error Codes: InvalidPlan, Success |
cufftSetWorkArea(cufftHandle, CUdeviceptr)
cufftSetWorkArea() overrides the work area pointer associated with a plan. If the work area was auto-allocated, CUFFT frees the auto-allocated space. The cufftExecute*() calls assume that the work area pointer is valid and that it points to a contiguous region in device memory that does not overlap with any other work area. If this is not the case, results are indeterminate.
Declaration
public static cufftResult cufftSetWorkArea(cufftHandle plan, CUdeviceptr workArea)
Parameters
Type | Name | Description |
---|---|---|
cufftHandle | plan | cufftHandle object |
CUdeviceptr | workArea | Pointer to workArea |
Returns
Type | Description |
---|---|
cufftResult |