Skip to main content

muFFT API Reference

1 Introduction

The muFFT library is a Fast Fourier Transform(FFT) product of the Moore Threads® MUSA® Toolkit.

The FFT is a divide-and-conquer algorithm that can efficiently compute discrete Fourier transforms of complex or real-valued data sets.

The muFFT library offers a simple interface for performing FFTs and supports a wide range of FFT inputs and options efficiently on an MT GPU, enabling users to quickly take use of the GPU's parallelism and floating-point capabilities in an FFT library.

2 Module Index

2.1 Modules

Here is a list of all modules:

Date Types
muFFT Library Functions

3 Module Documentation

3.1 Date Types

Macros

  • #define MUFFT_FORWARD - Perform a forward FFT.
  • #define MUFFT_INVERSE 1 Perform a backward/inverse FFT.

Typedefs

  • typedef enum mufftResult_t mufftResult Return status codes.
  • typedef enum mufftType_t mufftType Transform type.
  • typedef enum mufftLibraryPropertyType_t mufftLibraryPropertyType Property type.
  • typedef struct mufftHandle_t∗ mufftHandle A handle type used to store and access muFFT plans. The user receives a handle after creating a muFFT plan and uses this handle to execute the plan.
  • typedef float mufftReal A single-precision, floating-point real data type.
  • typedef double mufftDoubleReal A double-precision, floating-point real data type.
  • typedef muComplex mufftComplex A single-precision, floating-point complex data type that consists of interleaved real and imaginary components.
  • typedef muDoubleComplex mufftDoubleComplex A double-precision, floating-point complex data type that consists of interleaved real and imaginary components.

Enumerations

- enum mufftResult_t {
**MUFFT_SUCCESS** = 0 ,
**MUFFT_INVALID_PLAN** = 1 ,
**MUFFT_ALLOC_FAILED** = 2 ,
**MUFFT_INVALID_TYPE** = 3 ,
**MUFFT_INVALID_VALUE** = 4 ,
**MUFFT_INTERNAL_ERROR** = 5 ,
**MUFFT_EXEC_FAILED** = 6 ,
**MUFFT_SETUP_FAILED** = 7 ,
**MUFFT_INVALID_SIZE** = 8 ,
**MUFFT_UNALIGNED_DATA** = 9 ,
**MUFFT_INCOMPLETE_PARAMETER_LIST** = 0xA ,
**MUFFT_INVALID_DEVICE** ,
**MUFFT_PARSE_ERROR** = 0xC ,
**MUFFT_NO_WORKSPACE** ,
**MUFFT_NOT_IMPLEMENTED** ,
**MUFFT_LICENSE_ERROR** ,
**MUFFT_NOT_SUPPORTED** }
Return status codes.
- enum mufftType_t {
**MUFFT_R2C** = 0x2a ,
**MUFFT_C2R** = 0x2c ,
**MUFFT_C2C** = 0x29 ,
**MUFFT_D2Z** = 0x6a ,
**MUFFT_Z2D** = 0x6c ,
**MUFFT_Z2Z** = 0x69 }
Transform type.
- enum mufftLibraryPropertyType_t {
**MUFFT_MAJOR_VERSION** ,
**MUFFT_MINOR_VERSION** ,
**MUFFT_PATCH_LEVEL** }
Property type.

3.1.1 Detailed Description

This section covers data types used by muFFT API.

3.1.2 Typedef Documentation

3.1.2.1 mufftLibraryPropertyType

typedef enum mufftLibraryPropertyType_t mufftLibraryPropertyType

Property type.

libraryPropertyType data type is an enumeration of library property types.

3.1.2.2 mufftResult

typedef enum mufftResult_t mufftResult

Return status codes.

All muFFT Library return values except for MUFFT_SUCCESS indicate that the current API call failed and the user should reconfigure to correct the problem.

3.1.2.3 mufftType

typedef enum mufftType_t mufftType

Transform type.

This type is used to declare the Fourier transform type that will be executed. left most digit decide real or complex left second and third digit decide forward or inverse for real right most digit(the 7th) decide single/double

3.1.3 Enumeration Type Documentation

3.1.3.1 mufftLibraryPropertyType_t

enum mufftLibraryPropertyType_t

Property type.

libraryPropertyType data type is an enumeration of library property types.

3.1.3.2 mufftResult_t

enum mufftResult_t

Return status codes.

All muFFT Library return values except for MUFFT_SUCCESS indicate that the current API call failed and the user should reconfigure to correct the problem.

3.1.3.3 mufftType_t

enum mufftType_t

Transform type.

This type is used to declare the Fourier transform type that will be executed. left most digit decide real or complex left second and third digit decide forward or inverse for real right most digit(the 7th) decide single/double

3.2 muFFT Library Functions

Functions

  • mufftResult mufftPlan1d (mufftHandle∗plan, int nx, mufftType type, int batch) Create a new one-dimensional FFT plan.
  • mufftResult mufftPlan2d (mufftHandle∗plan, int nx, int ny, mufftType type) Create a new two-dimensional FFT plan.
  • mufftResult mufftPlan3d (mufftHandle∗plan, int nx, int ny, int nz, mufftType type) Create a new three-dimensional FFT plan.
  • mufftResult mufftPlanMany (mufftHandle∗plan, int rank, int∗n, int∗inembed, int istride, int idist, int ∗onembed, int ostride, int odist, mufftType type, int batch) Create a new batched rank-dimensional FFT plan.
  • mufftResult mufftCreate (mufftHandle∗plan) Allocate a new plan.
  • mufftResult mufftMakePlan1d (mufftHandle plan, int nx, mufftType type, int batch, size_t∗workSize) Initialize a new one-dimensional FFT plan.
  • mufftResult mufftMakePlan2d (mufftHandle plan, int nx, int ny, mufftType type, size_t∗workSize) Initialize a new two-dimensional FFT plan.
  • mufftResult mufftMakePlan3d (mufftHandle plan, int nx, int ny, int nz, mufftType type, size_t∗workSize) Initialize a new three-dimensional FFT plan.
  • mufftResult mufftMakePlanMany (mufftHandle plan, int rank, int∗n, int∗inembed, int istride, int idist, int ∗onembed, int ostride, int odist, mufftType type, int batch, size_t∗workSize) Initialize a new batched rank-dimensional FFT plan.
  • mufftResult mufftEstimate1d (int nx, mufftType type, int batch, size_t∗workSize) Return an estimate of the work area size required for a 1D plan.
  • mufftResult mufftEstimate2d (int nx, int ny, mufftType type, size_t∗workSize) Return an estimate of the work area size required for a 2D plan.
  • mufftResult mufftEstimate3d (int nx, int ny, int nz, mufftType type, size_t∗workSize) Return an estimate of the work area size required for a 3D plan.
  • mufftResult mufftEstimateMany (int rank, int∗n, int∗inembed, int istride, int idist, int∗onembed, int ostride, int odist, mufftType type, int batch, size_t∗workSize) Return an estimate of the work area size required for a rank-dimensional plan.
  • mufftResult mufftGetSize1d (mufftHandle plan, int nx, mufftType type, int batch, size_t∗workSize) Return size of the work area size required for a 1D plan.
  • mufftResult mufftGetSize2d (mufftHandle plan, int nx, int ny, mufftType type, size_t∗workSize) Return size of the work area size required for a 2D plan.
  • mufftResult mufftGetSize3d (mufftHandle plan, int nx, int ny, int nz, mufftType type, size_t∗workSize) Return size of the work area size required for a 3D plan.
  • mufftResult mufftGetSizeMany (mufftHandle plan, int rank, int∗n, int∗inembed, int istride, int idist, int ∗onembed, int ostride, int odist, mufftType type, int batch, size_t∗workSize) Return size of the work area size required for a rank-dimensional plan.
  • mufftResult mufftGetSize (mufftHandle plan, size_t∗workSize) Return size of the work area size required for a rank-dimensional plan.
  • mufftResult mufftSetAutoAllocation (mufftHandle plan, int autoAllocate) Set the plan's auto-allocation flag. The plan will allocate its own workarea.
  • mufftResult mufftSetWorkArea (mufftHandle plan, void∗workArea) Set the plan's work area.
  • mufftResult mufftDestroy (mufftHandle plan) Destroy and deallocate an existing plan.
  • mufftResult mufftExecC2C (mufftHandle plan, mufftComplex∗idata, mufftComplex∗odata, int direction)
Execute a (float) complex-to-complex FFT.
  • mufftResult mufftExecR2C (mufftHandle plan, mufftReal∗idata, mufftComplex∗odata) Execute a (float) real-to-complex FFT.
  • mufftResult mufftExecC2R (mufftHandle plan, mufftComplex∗idata, mufftReal∗odata) Execute a (float) complex-to-real FFT.
  • mufftResult mufftExecZ2Z (mufftHandle plan, mufftDoubleComplex∗idata, mufftDoubleComplex∗odata, int direction) Execute a (double) complex-to-complex FFT.
  • mufftResult mufftExecD2Z (mufftHandle plan, mufftDoubleReal∗idata, mufftDoubleComplex∗odata) Execute a (double) real-to-complex FFT.
  • mufftResult mufftExecZ2D (mufftHandle plan, mufftDoubleComplex∗idata, mufftDoubleReal∗odata) Execute a (double) complex-to-real FFT.
  • mufftResult mufftSetStream (mufftHandle plan, musaStream_t stream) Set MUSA stream to execute plan on.
  • mufftResult mufftGetVersion (int∗version) Get mtFFT/muFFT version.
  • mufftResult mufftGetProperty (mufftLibraryPropertyType type, int∗value) Get library property.

3.2.1 Detailed Description

This section describes how to use the muFFT library API.

3.2.2 Function Documentation

3.2.2.1 mufftCreate()

mufftResult mufftCreate ( mufftHandle∗plan)

Allocate a new plan.

Creates only an opaque handle, and allocates small data structures on the host. The mufftMakePlan∗() calls actually do the plan generation.

Parameters

out plan Pointer to a mufftHandle object.

Return values

MUFFT_SUCCESS muFFT successfully created the FFT plan.
MUFFT_ALLOC_FAILED The allocation of resources for the plan failed.
MUFFT_INVALID_VALUE One or more invalid parameters were passed to the API.
3.2.2.2 mufftDestroy()

mufftResult mufftDestroy ( mufftHandleplan)

Destroy and deallocate an existing plan.

Parameters

plan The mufftHandle object of the plan to be destroyed.

Return values

MUFFT_SUCCESS muFFT successfully destroyed the FFT plan.
MUFFT_INVALID_PLAN The plan parameter is not a valid handle.
3.2.2.3 mufftEstimate1d()

mufftResult mufftEstimate1d ( intnx, mufftTypetype, intbatch, size_t∗workSize)

Return an estimate of the work area size required for a 1D plan.

Parameters

in nx Number of elements in the x-direction.
in type FFT type.
in batch Number of batched transforms to compute.
out workSize Pointer to work area size (returned value).

Return values

MUFFT_SUCCESS muFFT successfully created the FFT plan.
MUFFT_ALLOC_FAILED The allocation of GPU resources for the plan failed.
MUFFT_INVALID_VALUE One or more invalid parameters were passed to the API.
MUFFT_INVALID_SIZE The nx or batch parameter is not a supported size.
3.2.2.4 mufftEstimate2d()

mufftResult mufftEstimate2d ( intnx, intny, mufftTypetype, size_t∗workSize)

Return an estimate of the work area size required for a 2D plan.

Parameters

in nx Number of elements in the x-direction.
in ny Number of elements in the y-direction.
in type FFT type.
out workSize Pointer to work area size (returned value).

Return values

MUFFT_SUCCESS muFFT successfully created the FFT plan.
MUFFT_ALLOC_FAILED The allocation of GPU resources for the plan failed.
MUFFT_INVALID_VALUE One or more invalid parameters were passed to the API.
MUFFT_INVALID_SIZE Either or both of the nx or ny parameters is not a supported size.
3.2.2.5 mufftEstimate3d()

mufftResult mufftEstimate3d ( intnx, intny, intnz, mufftTypetype, size_t∗workSize)

Return an estimate of the work area size required for a 3D plan.

Parameters

in nx Number of elements in the x-direction.
in ny Number of elements in the y-direction.
in nz Number of elements in the z-direction.
in type FFT type.
out workSize Pointer to work area size (returned value).

Return values

MUFFT_SUCCESS muFFT successfully created the FFT plan.
MUFFT_ALLOC_FAILED The allocation of GPU resources for the plan failed.
MUFFT_INVALID_VALUE One or more invalid parameters were passed to the API.

Return values

MUFFT_INVALID_SIZE One or more of the nx, ny, or nz parameters is not a supported size.
3.2.2.6 mufftEstimateMany()

mufftResult mufftEstimateMany ( intrank, int∗n, int∗inembed, intistride, intidist, int∗onembed, intostride, intodist, mufftTypetype, intbatch, size_t∗workSize)

Return an estimate of the work area size required for a rank-dimensional plan.

Parameters

in rank Dimension of FFT transform (1, 2, or 3).
in n Number of elements in the x/y/z directions.
in 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.
in istride Indicates the distance between two successive input elements in the least significant (i.e.,
innermost) dimension.
in idist Distance between input batches.
in 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.
in ostride Indicates the distance between two successive output elements in the output array in the
least significant (i.e., innermost) dimension.
in odist Distance between output batches.
in type FFT type.
in batch Number of batched transforms to perform.
out workSize Pointer to work area size (returned value).

Return values

MUFFT_SUCCESS muFFT successfully created the FFT plan.
MUFFT_ALLOC_FAILED The allocation of GPU resources for the plan failed.
MUFFT_INVALID_VALUE One or more invalid parameters were passed to the API.
MUFFT_INVALID_SIZE One or more of the parameters is not a supported size.
3.2.2.7 mufftExecC2C()

mufftResult mufftExecC2C ( mufftHandleplan, mufftComplex ∗idata, mufftComplex ∗odata, intdirection)

Execute a (float) complex-to-complex FFT.

If the input and output buffers are equal, an in-place transform is performed.

Parameters

in plan The FFT plan.
in idata Input data (on device).
out odata Output data (on device).
in direction EitherMUFFT_FORWARDorMUFFT_INVERSE.

Return values

MUFFT_SUCCESS muFFT successfully executed the FFT plan.
MUFFT_INVALID_PLAN The plan parameter is not a valid handle.
MUFFT_EXEC_FAILED muFFT failed to execute the transform on the GPU.
3.2.2.8 mufftExecC2R()

mufftResult mufftExecC2R ( mufftHandleplan, mufftComplex ∗idata, mufftReal∗odata)

Execute a (float) complex-to-real FFT.

If the input and output buffers are equal, an in-place transform is performed.

Parameters

in plan The FFT plan.
in idata Input data (on device).
out odata Output data (on device).

Return values

MUFFT_SUCCESS muFFT successfully executed the FFT plan.
MUFFT_INVALID_PLAN The plan parameter is not a valid handle.
MUFFT_EXEC_FAILED muFFT failed to execute the transform on the GPU.
3.2.2.9 mufftExecD2Z()

mufftResult mufftExecD2Z ( mufftHandleplan, mufftDoubleReal∗idata, mufftDoubleComplex∗odata)

Execute a (double) real-to-complex FFT.

If the input and output buffers are equal, an in-place transform is performed.

Parameters

in plan The FFT plan.
in idata Input data (on device).
out odata Output data (on device).

Return values

MUFFT_SUCCESS muFFT successfully executed the FFT plan.
MUFFT_INVALID_PLAN The plan parameter is not a valid handle.
MUFFT_EXEC_FAILED muFFT failed to execute the transform on the GPU.
3.2.2.10 mufftExecR2C()

mufftResult mufftExecR2C ( mufftHandleplan, mufftReal∗idata, mufftComplex ∗odata)

Execute a (float) real-to-complex FFT.

If the input and output buffers are equal, an in-place transform is performed.

Parameters

in plan The FFT plan.
in idata Input data (on device).
out odata Output data (on device).

Return values

MUFFT_SUCCESS muFFT successfully executed the FFT plan.
MUFFT_INVALID_PLAN The plan parameter is not a valid handle.
MUFFT_EXEC_FAILED muFFT failed to execute the transform on the GPU.
3.2.2.11 mufftExecZ2D()

mufftResult mufftExecZ2D ( mufftHandleplan, mufftDoubleComplex∗idata, mufftDoubleReal∗odata)

Execute a (double) complex-to-real FFT.

If the input and output buffers are equal, an in-place transform is performed.

Parameters

in plan The FFT plan.
in idata Input data (on device).
out odata Output data (on device).

Return values

MUFFT_SUCCESS muFFT successfully executed the FFT plan.
MUFFT_INVALID_PLAN The plan parameter is not a valid handle.
MUFFT_EXEC_FAILED muFFT failed to execute the transform on the GPU.
3.2.2.12 mufftExecZ2Z()

mufftResult mufftExecZ2Z ( mufftHandleplan, mufftDoubleComplex∗idata, mufftDoubleComplex∗odata, intdirection)

Execute a (double) complex-to-complex FFT.

If the input and output buffers are equal, an in-place transform is performed.

Parameters

in plan The FFT plan.
in idata Input data (on device).
out odata Output data (on device).
in direction EitherMUFFT_FORWARDorMUFFT_INVERSE.

Return values

MUFFT_SUCCESS muFFT successfully executed the FFT plan.

Return values

MUFFT_INVALID_PLAN The plan parameter is not a valid handle.
MUFFT_EXEC_FAILED muFFT failed to execute the transform on the GPU.
3.2.2.13 mufftGetProperty()

mufftResult mufftGetProperty ( mufftLibraryPropertyTypetype, int∗value)

Get library property.

Parameters

in type Property type.
out value Returned value.

Return values

MUFFT_SUCCESS The property value was successfully returned.
MUFFT_INVALID_TYPE The property type is not recognized.
3.2.2.14 mufftGetSize()

mufftResult mufftGetSize ( mufftHandleplan, size_t∗workSize)

Return size of the work area size required for a rank-dimensional plan.

Parameters

in plan Pointer to the FFT plan.
out workSize Pointer to the size(s), in bytes, of the work areas.

Return values

MUFFT_SUCCESS muFFT successfully returned the size of the work space.
MUFFT_INVALID_PLAN The plan parameter is not a valid handle.
3.2.2.15 mufftGetSize1d()

mufftResult mufftGetSize1d ( mufftHandleplan, intnx, mufftTypetype, intbatch, size_t∗workSize)

Return size of the work area size required for a 1D plan.

Parameters

in plan Pointer to the FFT plan.
in nx Number of elements in the x-direction.
in type FFT type.
in batch Number of batched transforms to compute.
out workSize Pointer to work area size (returned value).

Return values

MUFFT_SUCCESS muFFT successfully created the FFT plan.
MUFFT_ALLOC_FAILED The allocation of GPU resources for the plan failed.
MUFFT_INVALID_VALUE One or more invalid parameters were passed to the API.
MUFFT_INVALID_SIZE The nx or batch parameter is not a supported size.
3.2.2.16 mufftGetSize2d()

mufftResult mufftGetSize2d ( mufftHandleplan, intnx, intny, mufftTypetype, size_t∗workSize)

Return size of the work area size required for a 2D plan.

Parameters

in plan Pointer to the FFT plan.
in nx Number of elements in the x-direction.
in ny Number of elements in the y-direction.
in type FFT type.
out workSize Pointer to work area size (returned value).

Return values

MUFFT_SUCCESS muFFT successfully created the FFT plan.

Return values

MUFFT_ALLOC_FAILED The allocation of GPU resources for the plan failed.
MUFFT_INVALID_VALUE One or more invalid parameters were passed to the API.
MUFFT_INVALID_SIZE Either or both of the nx or ny parameters is not a supported size.
3.2.2.17 mufftGetSize3d()

mufftResult mufftGetSize3d ( mufftHandleplan, intnx, intny, intnz, mufftTypetype, size_t∗workSize)

Return size of the work area size required for a 3D plan.

Parameters

in plan Pointer to the FFT plan.
in nx Number of elements in the x-direction.
in ny Number of elements in the y-direction.
in nz Number of elements in the z-direction.
in type FFT type.
out workSize Pointer to work area size (returned value).

Return values

MUFFT_SUCCESS muFFT successfully created the FFT plan.
MUFFT_ALLOC_FAILED The allocation of GPU resources for the plan failed.
MUFFT_INVALID_VALUE One or more invalid parameters were passed to the API.
MUFFT_INVALID_SIZE One or more of the nx, ny, or nz parameters is not a supported size.
3.2.2.18 mufftGetSizeMany()

mufftResult mufftGetSizeMany ( mufftHandleplan, intrank, int∗n, int∗inembed, intistride, intidist, int∗onembed, intostride,

intodist,
mufftTypetype,
intbatch,
size_t∗workSize)

Return size of the work area size required for a rank-dimensional plan.

Parameters

in plan Pointer to the FFT plan.
in rank Dimension of FFT transform (1, 2, or 3).
in n Number of elements in the x/y/z directions.
in 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.
in istride Indicates the distance between two successive input elements in the least significant (i.e.,
innermost) dimension.
in idist Distance between input batches.
in 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.
in ostride Indicates the distance between two successive output elements in the output array in the
least significant (i.e., innermost) dimension.
in odist Distance between output batches.
in type FFT type.
in batch Number of batched transforms to perform.
out workSize Pointer to work area size (returned value).

Return values

MUFFT_SUCCESS muFFT successfully created the FFT plan.
MUFFT_ALLOC_FAILED The allocation of GPU resources for the plan failed.
MUFFT_INVALID_VALUE One or more invalid parameters were passed to the API.
MUFFT_INVALID_SIZE One or more of the parameters is not a supported size.
3.2.2.19 mufftGetVersion()

mufftResult mufftGetVersion ( int∗version )

Get mtFFT/muFFT version.

Parameters

out version muFFT/mtFFT version (returned value).

Return values

MUFFT_SUCCESS muFFT successfully returned the version number.
3.2.2.20 mufftMakePlan1d()

mufftResult mufftMakePlan1d ( mufftHandleplan, intnx, mufftTypetype, intbatch, size_t∗workSize)

Initialize a new one-dimensional FFT plan.

Assumes that the plan has been created already, and modifies the plan associated with the plan handle.

Parameters

in plan Handle of the FFT plan.
in nx FFT length.
in type FFT type.
in batch Number of batched transforms to compute.
out workSize Pointer to work area size (returned value).

Return values

MUFFT_SUCCESS muFFT successfully created the FFT plan.
MUFFT_INVALID_PLAN The plan parameter is not a valid handle.
MUFFT_ALLOC_FAILED The allocation of GPU resources for the plan failed.
MUFFT_INVALID_VALUE One or more invalid parameters were passed to the API.
MUFFT_INVALID_SIZE The nx or batch parameter is not a supported size.
3.2.2.21 mufftMakePlan2d()

mufftResult mufftMakePlan2d ( mufftHandleplan, intnx, intny, mufftTypetype, size_t∗workSize)

Initialize a new two-dimensional FFT plan.

Assumes that the plan has been created already, and modifies the plan associated with the plan handle. Two- dimensional data should be stored in C ordering (row-major format), so that indexes in y-direction (j index) vary the fastest.

Parameters

in plan Handle of the FFT plan.

Parameters

in nx Number of elements in the x-direction (slow index).
in ny Number of elements in the y-direction (fast index).
in type FFT type.
out workSize Pointer to work area size (returned value).

Return values

MUFFT_SUCCESS muFFT successfully created the FFT plan.
MUFFT_INVALID_PLAN The plan parameter is not a valid handle.
MUFFT_ALLOC_FAILED The allocation of GPU resources for the plan failed.
MUFFT_INVALID_VALUE One or more invalid parameters were passed to the API.
MUFFT_INVALID_SIZE Either or both of the nx or ny parameters is not a supported size.
3.2.2.22 mufftMakePlan3d()

mufftResult mufftMakePlan3d ( mufftHandleplan, intnx, intny, intnz, mufftTypetype, size_t∗workSize)

Initialize a new three-dimensional FFT plan.

Assumes that the plan has been created already, and modifies the plan associated with the plan handle. Three- dimensional data should be stored in C ordering (row-major format), so that indexes in z-direction (k index) vary the fastest.

Parameters

in plan Handle of the FFT plan.
in nx Number of elements in the x-direction (slowest index).
in ny Number of elements in the y-direction.
in nz Number of elements in the z-direction (fastest index).
in type FFT type.
out workSize Pointer to work area size (returned value).

Return values

MUFFT_SUCCESS muFFT successfully created the FFT plan.
MUFFT_INVALID_PLAN The plan parameter is not a valid handle.
MUFFT_ALLOC_FAILED The allocation of GPU resources for the plan failed.
MUFFT_INVALID_VALUE One or more invalid parameters were passed to the API.
MUFFT_INVALID_SIZE One or more of the nx, ny, or nz parameters is not a supported size.
3.2.2.23 mufftMakePlanMany()

mufftResult mufftMakePlanMany ( mufftHandleplan, intrank, int∗n, int∗inembed, intistride, intidist, int∗onembed, intostride, intodist, mufftTypetype, intbatch, size_t∗workSize)

Initialize a new batched rank-dimensional FFT plan.

Assumes that the plan has been created already, and modifies the plan associated with the plan handle. The batch parameter tells muFFT how many transforms to perform. Used in complicated usage case like flexible input and output layout.

Parameters

out plan Pointer to the FFT plan handle.
in rank Dimension of FFT transform (1, 2, or 3).
in n Number of elements in the x/y/z directions.
in 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.
in istride Indicates the distance between two successive input elements in the least significant (i.e.,
innermost) dimension.
in idist Distance between input batches.
in 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.
in ostride Indicates the distance between two successive output elements in the output array in the
least significant (i.e., innermost) dimension.
in odist Distance between output batches.
in type FFT type (e.g., MUFFT_R2C for single precision real to complex).
in batch Number of batched transforms to perform.
out workSize Pointer to work area size (returned value).

Return values

MUFFT_SUCCESS muFFT successfully created the FFT plan.
MUFFT_INVALID_PLAN The plan parameter is not a valid handle.
MUFFT_ALLOC_FAILED The allocation of GPU resources for the plan failed.
MUFFT_INVALID_VALUE One or more invalid parameters were passed to the API.
MUFFT_INVALID_SIZE One or more of the parameters is not a supported size.
3.2.2.24 mufftPlan1d()

mufftResult mufftPlan1d ( mufftHandle∗plan, intnx, mufftTypetype, intbatch)

Create a new one-dimensional FFT plan.

Allocate and initialize a new one-dimensional FFT plan.

Parameters

out plan Pointer to the FFT plan handle.
in nx FFT length.
in type FFT type.
in batch Number of batched transforms to compute.

Return values

MUFFT_SUCCESS muFFT successfully created the FFT plan.
MUFFT_INVALID_PLAN The plan parameter is not a valid handle.
MUFFT_ALLOC_FAILED The allocation of GPU resources for the plan failed.
MUFFT_INVALID_VALUE One or more invalid parameters were passed to the API.
MUFFT_INVALID_SIZE The nx or batch parameter is not a supported size.
3.2.2.25 mufftPlan2d()

mufftResult mufftPlan2d ( mufftHandle∗plan, intnx, intny, mufftTypetype)

Create a new two-dimensional FFT plan.

Allocate and initialize a new two-dimensional FFT plan. Two-dimensional data should be stored in C ordering (row- major format), so that indexes in y-direction (j index) vary the fastest.

Parameters

out plan Pointer to the FFT plan handle.
in nx Number of elements in the x-direction (slow index).
in ny Number of elements in the y-direction (fast index).
in type FFT type.

Return values

MUFFT_SUCCESS muFFT successfully created the FFT plan.
MUFFT_INVALID_PLAN The plan parameter is not a valid handle.
MUFFT_ALLOC_FAILED The allocation of GPU resources for the plan failed.
MUFFT_INVALID_VALUE One or more invalid parameters were passed to the API.
MUFFT_INVALID_SIZE Either or both of the nx or ny parameters is not a supported size.
3.2.2.26 mufftPlan3d()

mufftResult mufftPlan3d ( mufftHandle∗plan, intnx, intny, intnz, mufftTypetype)

Create a new three-dimensional FFT plan.

Allocate and initialize a new three-dimensional FFT plan. Three-dimensional data should be stored in C ordering (row-major format), so that indexes in z-direction (k index) vary the fastest.

Parameters

out plan Pointer to the FFT plan handle.
in nx Number of elements in the x-direction (slowest index).
in ny Number of elements in the y-direction.
in nz Number of elements in the z-direction (fastest index).
in type FFT type.

Return values

MUFFT_SUCCESS muFFT successfully created the FFT plan.
MUFFT_INVALID_PLAN The plan parameter is not a valid handle.
MUFFT_ALLOC_FAILED The allocation of GPU resources for the plan failed.
MUFFT_INVALID_VALUE One or more invalid parameters were passed to the API.
MUFFT_INVALID_SIZE One or more of the nx, ny, or nz parameters is not a supported size.
3.2.2.27 mufftPlanMany()

mufftResult mufftPlanMany ( mufftHandle∗plan, intrank, int∗n,

int∗inembed,
intistride,
intidist,
int∗onembed,
intostride,
intodist,
mufftTypetype,
intbatch)

Create a new batched rank-dimensional FFT plan.

Allocate and initialize a new batched rank-dimensional FFT. The batch parameter tells muFFT how many transforms to perform. Used in complicated usage case like flexible input and output layout.

Parameters

out plan Pointer to the FFT plan handle.
in rank Dimension of FFT transform (1, 2, or 3).
in n Number of elements in the x/y/z directions.
in 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.
in istride Indicates the distance between two successive input elements in the least significant (i.e.,
innermost) dimension.
in idist Distance between input batches.
in 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.
in ostride Indicates the distance between two successive output elements in the output array in the
least significant (i.e., innermost) dimension.
in odist Distance between output batches.
in type FFT type (e.g., MUFFT_R2C for single precision real to complex).
in batch Number of batched transforms to perform.

Return values

MUFFT_SUCCESS muFFT successfully created the FFT plan.
MUFFT_INVALID_PLAN The plan parameter is not a valid handle.
MUFFT_ALLOC_FAILED The allocation of GPU resources for the plan failed.
MUFFT_INVALID_VALUE One or more invalid parameters were passed to the API.
MUFFT_INVALID_SIZE One or more of the parameters is not a supported size.
3.2.2.28 mufftSetAutoAllocation()

mufftResult mufftSetAutoAllocation ( mufftHandleplan, intautoAllocate )

Set the plan's auto-allocation flag. The plan will allocate its own workarea.

Parameters

in plan Pointer to the FFT plan.
in autoAllocate 0 to disable auto-allocation, non-zero to enable.

Return values

MUFFT_SUCCESS muFFT successfully allows user to manage work area.
MUFFT_INVALID_PLAN The plan parameter is not a valid handle.
3.2.2.29 mufftSetStream()

mufftResult mufftSetStream ( mufftHandleplan, musaStream_t stream)

Set MUSA stream to execute plan on.

Associates a MUSA stream with a muFFT plan. All kernels launched by this plan are associated with the provided stream.

Parameters

plan The FFT plan.
stream The MUSA stream.

Return values

MUFFT_SUCCESS The stream was associated with the plan.
MUFFT_INVALID_PLAN The plan parameter is not a valid handle.
3.2.2.30 mufftSetWorkArea()

mufftResult mufftSetWorkArea ( mufftHandleplan, void∗workArea)

Set the plan's work area.

Parameters

in plan Pointer to the FFT plan.
in workArea Pointer to the work area (on device).

Return values

MUFFT_SUCCESS muFFT successfully allows user to override workArea pointer.
MUFFT_INVALID_PLAN The plan parameter is not a valid handle.
MUFFT_ALLOC_FAILED free the original GPU resources for the plan failed.
MUFFT_INVALID_VALUE One or more invalid parameters were in the passed plan.