Skip to main content

muFFT API 参考


目录


Files


File mufft.h

Location: mufft.h

mufft.h defines all the public interfaces and types

Includes

  • <muComplex.h>
  • <musa_runtime.h>
  • mufft-export.h

Included by

Macros

Macro MUFFT_FORWARD

#define MUFFT_FORWARD -1

Perform a forward FFT.

Macro MUFFT_INVERSE

#define MUFFT_INVERSE 1

Perform a backward/inverse FFT.

Enumeration types

Enumeration type mufftResult_t

Definition: mufft.h (line 52)

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 =
0xB,
MUFFT_PARSE_ERROR = 0xC,
MUFFT_NO_WORKSPACE =
0xD,
MUFFT_NOT_IMPLEMENTED =
0xE,
MUFFT_LICENSE_ERROR =
0xF,
MUFFT_NOT_SUPPORTED =
0x10
\}

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.

Enumerator MUFFT_SUCCESS

Enumerator MUFFT_INVALID_PLAN

Enumerator MUFFT_ALLOC_FAILED

Enumerator MUFFT_INVALID_TYPE

Enumerator MUFFT_INVALID_VALUE

Enumerator MUFFT_INTERNAL_ERROR

Enumerator MUFFT_EXEC_FAILED

Enumerator MUFFT_SETUP_FAILED

Enumerator MUFFT_INVALID_SIZE

Enumerator MUFFT_UNALIGNED_DATA

Enumerator MUFFT_INCOMPLETE_PARAMETER_LIST

Enumerator MUFFT_INVALID_DEVICE

Enumerator MUFFT_PARSE_ERROR

Enumerator MUFFT_NO_WORKSPACE

Enumerator MUFFT_NOT_IMPLEMENTED

Enumerator MUFFT_LICENSE_ERROR

Enumerator MUFFT_NOT_SUPPORTED

Enumeration type mufftType_t

Definition: mufft.h (line 84)

enum mufftType_t \{
MUFFT_R2C = 0x2a,
MUFFT_C2R = 0x2c,
MUFFT_C2C = 0x29,
MUFFT_D2Z = 0x6a,
MUFFT_Z2D = 0x6c,
MUFFT_Z2Z = 0x69
\}

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

Enumerator MUFFT_R2C

Enumerator MUFFT_C2R

Enumerator MUFFT_C2C

Enumerator MUFFT_D2Z

Enumerator MUFFT_Z2D

Enumerator MUFFT_Z2Z

Typedefs

Typedef mufftResult

Definition: mufft.h (line 75)

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.

Return type: enum mufftResult_t

Typedef mufftType

Definition: mufft.h (line 91)

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

Return type: enum mufftType_t

Typedef mufftHandle

Definition: mufft.h (line 103)

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.

Return type: struct mufftHandle_t *

Typedef mufftReal

Definition: mufft.h (line 106)

typedef float mufftReal

A single-precision, floating-point real data type.

Return type: float

Typedef mufftDoubleReal

Definition: mufft.h (line 109)

typedef double mufftDoubleReal

A double-precision, floating-point real data type.

Return type: double

Typedef mufftComplex

Definition: mufft.h (line 113)

typedef muComplex mufftComplex

A single-precision, floating-point complex data type that consists of interleaved real and imaginary components.

Return type: muComplex

Typedef mufftDoubleComplex

Definition: mufft.h (line 117)

typedef muDoubleComplex mufftDoubleComplex

A double-precision, floating-point complex data type that consists of interleaved real and imaginary components.

Return type: muDoubleComplex

Functions

Function mufftPlan1d

MUFFT_EXPORT mufftResult mufftPlan1d(mufftHandle *plan, int nx, mufftType type, int batch)

Create a new one-dimensional FFT plan.

Allocate and initialize a new one-dimensional FFT plan.

Parameters:

  • plan: Pointer to the FFT plan handle.
  • nx: FFT length.
  • type: FFT type.
  • 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.

Parameters:

[mufftHandle](#mufft_8h_1a8f7720b787c5ceaa6ebe8688f83616de) plan

Return type: MUFFT_EXPORT mufftResult

Function mufftPlan2d

MUFFT_EXPORT mufftResult mufftPlan2d(mufftHandle *plan, int nx, int ny, mufftType type)

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:

  • plan: Pointer to the FFT plan handle.
  • nx: Number of elements in the x-direction (slow index).
  • ny: Number of elements in the y-direction (fast index).
  • 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.

Parameters:

[mufftHandle](#mufft_8h_1a8f7720b787c5ceaa6ebe8688f83616de) plan

Return type: MUFFT_EXPORT mufftResult

Function mufftPlan3d

MUFFT_EXPORT mufftResult mufftPlan3d(mufftHandle *plan, int nx, int ny, int nz, mufftType type)

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:

  • plan: Pointer to the FFT plan handle.
  • nx: Number of elements in the x-direction (slowest index).
  • ny: Number of elements in the y-direction.
  • nz: Number of elements in the z-direction (fastest index).
  • 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.

Parameters:

[mufftHandle](#mufft_8h_1a8f7720b787c5ceaa6ebe8688f83616de) plan

Return type: MUFFT_EXPORT mufftResult

Function mufftPlanMany

MUFFT_EXPORT 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.

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:

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

Parameters:

[mufftHandle](#mufft_8h_1a8f7720b787c5ceaa6ebe8688f83616de) plan

  • int rank int n int inembed
  • int istride
  • int idist int onembed
  • int ostride
  • int odist
  • mufftType type
  • int batch

Return type: MUFFT_EXPORT mufftResult

Function mufftCreate

MUFFT_EXPORT 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:

  • 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.

Parameters:

[mufftHandle](#mufft_8h_1a8f7720b787c5ceaa6ebe8688f83616de) plan

Return type: MUFFT_EXPORT mufftResult

Function mufftMakePlan1d

MUFFT_EXPORT mufftResult mufftMakePlan1d(mufftHandle plan, int nx, mufftType type, int batch, 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:

  • plan: Handle of the FFT plan.
  • nx: FFT length.
  • type: FFT type.
  • batch: Number of batched transforms to compute.
  • 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.

Parameters:

Return type: MUFFT_EXPORT mufftResult

Function mufftMakePlan2d

MUFFT_EXPORT mufftResult mufftMakePlan2d(mufftHandle plan, int nx, int ny, mufftType type, 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:

  • plan: Handle of the FFT plan.
  • nx: Number of elements in the x-direction (slow index).
  • ny: Number of elements in the y-direction (fast index).
  • type: FFT type.
  • 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.

Parameters:

Return type: MUFFT_EXPORT mufftResult

Function mufftMakePlan3d

MUFFT_EXPORT mufftResult mufftMakePlan3d(mufftHandle plan, int nx, int ny, int nz, mufftType type, 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:

  • plan: Handle of the FFT plan.
  • nx: Number of elements in the x-direction (slowest index).
  • ny: Number of elements in the y-direction.
  • nz: Number of elements in the z-direction (fastest index).
  • type: FFT type.
  • 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.

Parameters:

Return type: MUFFT_EXPORT mufftResult

Function mufftMakePlanMany

MUFFT_EXPORT 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.

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:

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

Parameters:

  • 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 type: MUFFT_EXPORT mufftResult

Function mufftEstimate1d

MUFFT_EXPORT mufftResult mufftEstimate1d(int nx, mufftType type, int batch, size_t *workSize)

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

Parameters:

  • nx: Number of elements in the x-direction.
  • type: FFT type.
  • batch: Number of batched transforms to compute.
  • 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.

Parameters:

  • int nx
  • mufftType type
  • int batch size_t workSize

Return type: MUFFT_EXPORT mufftResult

Function mufftEstimate2d

MUFFT_EXPORT mufftResult mufftEstimate2d(int nx, int ny, mufftType type, size_t *workSize)

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

Parameters:

  • nx: Number of elements in the x-direction.
  • ny: Number of elements in the y-direction.
  • type: FFT type.
  • 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.

Parameters:

  • int nx
  • int ny
  • mufftType type size_t workSize

Return type: MUFFT_EXPORT mufftResult

Function mufftEstimate3d

MUFFT_EXPORT 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.

Parameters:

  • nx: Number of elements in the x-direction.
  • ny: Number of elements in the y-direction.
  • nz: Number of elements in the z-direction.
  • type: FFT type.
  • 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.

Parameters:

  • int nx
  • int ny
  • int nz
  • mufftType type size_t workSize

Return type: MUFFT_EXPORT mufftResult

Function mufftEstimateMany

MUFFT_EXPORT 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.

Parameters:

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

Parameters:

  • int rank int n int inembed
  • int istride
  • int idist int onembed
  • int ostride
  • int odist
  • mufftType type
  • int batch size_t workSize

Return type: MUFFT_EXPORT mufftResult

Function mufftGetSize1d

MUFFT_EXPORT 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.

Parameters:

  • plan: Pointer to the FFT plan.
  • nx: Number of elements in the x-direction.
  • type: FFT type.
  • batch: Number of batched transforms to compute.
  • 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.

Parameters:

Return type: MUFFT_EXPORT mufftResult

Function mufftGetSize2d

MUFFT_EXPORT 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.

Parameters:

  • plan: Pointer to the FFT plan.
  • nx: Number of elements in the x-direction.
  • ny: Number of elements in the y-direction.
  • type: FFT type.
  • 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.

Parameters:

Return type: MUFFT_EXPORT mufftResult

Function mufftGetSize3d

MUFFT_EXPORT 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.

Parameters:

  • plan: Pointer to the FFT plan.
  • nx: Number of elements in the x-direction.
  • ny: Number of elements in the y-direction.
  • nz: Number of elements in the z-direction.
  • type: FFT type.
  • 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.

Parameters:

Return type: MUFFT_EXPORT mufftResult

Function mufftGetSizeMany

MUFFT_EXPORT 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.

Parameters:

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

Parameters:

  • 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 type: MUFFT_EXPORT mufftResult

Function mufftGetSize

MUFFT_EXPORT mufftResult mufftGetSize(mufftHandle plan, size_t *workSize)

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

Parameters:

  • plan: Pointer to the FFT plan.
  • 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.

Parameters:

Return type: MUFFT_EXPORT mufftResult

Function mufftSetAutoAllocation

MUFFT_EXPORT mufftResult mufftSetAutoAllocation(mufftHandle plan, int autoAllocate)

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

Parameters:

  • plan: Pointer to the FFT plan.
  • 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.

Parameters:

Return type: MUFFT_EXPORT mufftResult

Function mufftSetWorkArea

MUFFT_EXPORT mufftResult mufftSetWorkArea(mufftHandle plan, void *workArea)

Set the plan's work area.

Parameters:

  • plan: Pointer to the FFT plan.
  • 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.

Parameters:

Return type: MUFFT_EXPORT mufftResult

Function mufftDestroy

MUFFT_EXPORT mufftResult mufftDestroy(mufftHandle plan)

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.

Parameters:

Return type: MUFFT_EXPORT mufftResult

Function mufftExecC2C

MUFFT_EXPORT mufftResult mufftExecC2C(mufftHandle plan, mufftComplex `idata, mufftComplex `odata, int direction)

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

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

Parameters:

  • plan: The FFT plan.
  • idata: Input data (on device).
  • odata: Output data (on device).
  • direction: Either MUFFT_FORWARD or MUFFT_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.

Parameters:

  • mufftHandle plan [mufftComplex](#mufft_8h_1af6daf5e4faf75a3fceff758eace7df6a) idata [mufftComplex](#mufft_8h_1af6daf5e4faf75a3fceff758eace7df6a) odata
  • int direction

Return type: MUFFT_EXPORT mufftResult

Function mufftExecR2C

MUFFT_EXPORT mufftResult mufftExecR2C(mufftHandle plan, 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:

  • plan: The FFT plan.
  • idata: Input data (on device).
  • 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.

Parameters:

  • mufftHandle plan [mufftReal](#mufft_8h_1aa50da68f4bc4a707ee2685cb0c616925) idata [mufftComplex](#mufft_8h_1af6daf5e4faf75a3fceff758eace7df6a) odata

Return type: MUFFT_EXPORT mufftResult

Function mufftExecC2R

MUFFT_EXPORT mufftResult mufftExecC2R(mufftHandle plan, 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:

  • plan: The FFT plan.
  • idata: Input data (on device).
  • 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.

Parameters:

  • mufftHandle plan [mufftComplex](#mufft_8h_1af6daf5e4faf75a3fceff758eace7df6a) idata [mufftReal](#mufft_8h_1aa50da68f4bc4a707ee2685cb0c616925) odata

Return type: MUFFT_EXPORT mufftResult

Function mufftExecZ2Z

MUFFT_EXPORT mufftResult mufftExecZ2Z(mufftHandle plan, mufftDoubleComplex `idata, mufftDoubleComplex `odata, int direction)

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

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

Parameters:

  • plan: The FFT plan.
  • idata: Input data (on device).
  • odata: Output data (on device).
  • direction: Either MUFFT_FORWARD or MUFFT_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.

Parameters:

  • mufftHandle plan [mufftDoubleComplex](#mufft_8h_1aadc3683b55485985c20d9720a334ff43) idata [mufftDoubleComplex](#mufft_8h_1aadc3683b55485985c20d9720a334ff43) odata
  • int direction

Return type: MUFFT_EXPORT mufftResult

Function mufftExecD2Z

MUFFT_EXPORT mufftResult mufftExecD2Z(mufftHandle plan, 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:

  • plan: The FFT plan.
  • idata: Input data (on device).
  • 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.

Parameters:

  • mufftHandle plan [mufftDoubleReal](#mufft_8h_1a43236074083ef0ccff93845be0c9f64f) idata [mufftDoubleComplex](#mufft_8h_1aadc3683b55485985c20d9720a334ff43) odata

Return type: MUFFT_EXPORT mufftResult

Function mufftExecZ2D

MUFFT_EXPORT mufftResult mufftExecZ2D(mufftHandle plan, 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:

  • plan: The FFT plan.
  • idata: Input data (on device).
  • 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.

Parameters:

  • mufftHandle plan [mufftDoubleComplex](#mufft_8h_1aadc3683b55485985c20d9720a334ff43) idata [mufftDoubleReal](#mufft_8h_1a43236074083ef0ccff93845be0c9f64f) odata

Return type: MUFFT_EXPORT mufftResult

Function mufftSetStream

MUFFT_EXPORT mufftResult mufftSetStream(mufftHandle plan, 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.

Parameters:

Return type: MUFFT_EXPORT mufftResult

Function mufftGetVersion

MUFFT_EXPORT mufftResult mufftGetVersion(int *version)

Get mtFFT/muFFT version.

Parameters:

  • version: muFFT/mtFFT version (returned value).

Return values:

  • MUFFT_SUCCESS: muFFT successfully returned the version number.

Parameters:

int version

Return type: MUFFT_EXPORT mufftResult

Function mufftGetProperty

MUFFT_EXPORT mufftResult mufftGetProperty(libraryPropertyType type, int *value)

Get library property.

Parameters:

  • type: Property type.
  • value: Returned value.

Return values:

  • MUFFT_SUCCESS: The property value was successfully returned.
  • MUFFT_INVALID_TYPE: The property type is not recognized.

Parameters:

  • libraryPropertyType type int value

Return type: MUFFT_EXPORT mufftResult


File mufftXt.h

Location: mufftXt.h

mufftXt.h defines all the public interfaces and types

Classes

Includes

  • musalibxt.h
  • mufft.h
  • mufft-export.h

Enumeration types

Enumeration type mufftXtSubFormat_t

Definition: mufftXt.h (line 50)

enum mufftXtSubFormat_t \{
MUFFT_XT_FORMAT_INPUT =
0x00,
MUFFT_XT_FORMAT_OUTPUT =
0x01,
MUFFT_XT_FORMAT_INPLACE =
0x02,
MUFFT_XT_FORMAT_INPLACE_SHUFFLED =
0x03,
MUFFT_XT_FORMAT_1D_INPUT_SHUFFLED =
0x04,
MUFFT_XT_FORMAT_DISTRIBUTED_INPUT = 0x05,
MUFFT_XT_FORMAT_DISTRIBUTED_OUTPUT = 0x06,
MUFFT_FORMAT_UNDEFINED = 0x07
\}

Data layout.

mufftXtSubFormat identifies the data layout of a memory descriptor owned by mufft.

Enumerator MUFFT_XT_FORMAT_INPUT

Enumerator MUFFT_XT_FORMAT_OUTPUT

Enumerator MUFFT_XT_FORMAT_INPLACE

Enumerator MUFFT_XT_FORMAT_INPLACE_SHUFFLED

Enumerator MUFFT_XT_FORMAT_1D_INPUT_SHUFFLED

Enumerator MUFFT_XT_FORMAT_DISTRIBUTED_INPUT

Enumerator MUFFT_XT_FORMAT_DISTRIBUTED_OUTPUT

Enumerator MUFFT_FORMAT_UNDEFINED

Enumeration type mufftXtCopyType_t

Definition: mufftXt.h (line 69)

enum mufftXtCopyType_t \{
MUFFT_COPY_HOST_TO_DEVICE = 0x00,
MUFFT_COPY_DEVICE_TO_HOST = 0x01,
MUFFT_COPY_DEVICE_TO_DEVICE = 0x02,
MUFFT_COPY_UNDEFINED = 0x03
\}

Copy type.

mufftXtCopyType specifies the type of copy for mufftXtMemcpy.

Enumerator MUFFT_COPY_HOST_TO_DEVICE

Enumerator MUFFT_COPY_DEVICE_TO_HOST

Enumerator MUFFT_COPY_DEVICE_TO_DEVICE

Enumerator MUFFT_COPY_UNDEFINED

Enumeration type mufftXtQueryType_t

Definition: mufftXt.h (line 79)

enum mufftXtQueryType_t \{
MUFFT_QUERY_1D_FACTORS = 0x00,
MUFFT_QUERY_UNDEFINED = 0x01
\}

Query type.

mufftXtQueryType specifies the type of query for mufftXtQueryPlan.

Enumerator MUFFT_QUERY_1D_FACTORS

Enumerator MUFFT_QUERY_UNDEFINED

Enumeration type mufftXtWorkAreaPolicy_t

Definition: mufftXt.h (line 107)

enum mufftXtWorkAreaPolicy_t \{
MUFFT_WORKAREA_MINIMAL = 0,
MUFFT_WORKAREA_USER = 1,
MUFFT_WORKAREA_PERFORMANCE = 2
\}

WorkArea Policy.

mufftXtWorkAreaPolicy specifies policy for mufftXtSetWorkAreaPolicy.

Enumerator MUFFT_WORKAREA_MINIMAL

Enumerator MUFFT_WORKAREA_USER

Enumerator MUFFT_WORKAREA_PERFORMANCE

Enumeration type mufftXtCallbackType_t

Definition: mufftXt.h (line 376)

enum mufftXtCallbackType_t \{
MUFFT_CB_LD_COMPLEX = 0x0,
MUFFT_CB_LD_COMPLEX_DOUBLE = 0x1,
MUFFT_CB_LD_REAL = 0x2,
MUFFT_CB_LD_REAL_DOUBLE = 0x3,
MUFFT_CB_ST_COMPLEX = 0x4,
MUFFT_CB_ST_COMPLEX_DOUBLE = 0x5,
MUFFT_CB_ST_REAL = 0x6,
MUFFT_CB_ST_REAL_DOUBLE = 0x7,
MUFFT_CB_UNDEFINED = 0x8
\}

Callback type @detailsThe muFFT library supports callback funtions for all combinations of single or double precision, real or complex data, load or store. These are enumerated in the parameter mufftXtCallbackType.

Enumerator MUFFT_CB_LD_COMPLEX

Enumerator MUFFT_CB_LD_COMPLEX_DOUBLE

Enumerator MUFFT_CB_LD_REAL

Enumerator MUFFT_CB_LD_REAL_DOUBLE

Enumerator MUFFT_CB_ST_COMPLEX

Enumerator MUFFT_CB_ST_COMPLEX_DOUBLE

Enumerator MUFFT_CB_ST_REAL

Enumerator MUFFT_CB_ST_REAL_DOUBLE

Enumerator MUFFT_CB_UNDEFINED

Typedefs

Typedef mufftXtSubFormat

Definition: mufftXt.h (line 64)

typedef enum mufftXtSubFormat_t mufftXtSubFormat

Data layout.

mufftXtSubFormat identifies the data layout of a memory descriptor owned by mufft.

Return type: enum mufftXtSubFormat_t

Typedef mufftXtCopyType

Definition: mufftXt.h (line 74)

typedef enum mufftXtCopyType_t mufftXtCopyType

Copy type.

mufftXtCopyType specifies the type of copy for mufftXtMemcpy.

Return type: enum mufftXtCopyType_t

Typedef mufftXtQueryType

Definition: mufftXt.h (line 82)

typedef enum mufftXtQueryType_t mufftXtQueryType

Query type.

mufftXtQueryType specifies the type of query for mufftXtQueryPlan.

Return type: enum mufftXtQueryType_t

Typedef mufftXt1dFactors

Definition: mufftXt.h (line 101)

typedef struct mufftXt1dFactors_t mufftXt1dFactors

The return struct of query for mufftXtQueryPlan.

Return type: struct mufftXt1dFactors_t

Typedef mufftXtWorkAreaPolicy

Definition: mufftXt.h (line 111)

typedef enum mufftXtWorkAreaPolicy_t mufftXtWorkAreaPolicy

WorkArea Policy.

mufftXtWorkAreaPolicy specifies policy for mufftXtSetWorkAreaPolicy.

Return type: enum mufftXtWorkAreaPolicy_t

Typedef mufftXtCallbackType

Definition: mufftXt.h (line 386)

typedef enum mufftXtCallbackType_t mufftXtCallbackType

Callback type @detailsThe muFFT library supports callback funtions for all combinations of single or double precision, real or complex data, load or store. These are enumerated in the parameter mufftXtCallbackType.

Return type: enum mufftXtCallbackType_t

Typedef mufftCallbackLoadC

Definition: mufftXt.h (line 390)

typedef mufftComplex(` mufftCallbackLoadC) (void `dataIn, size_t offset, void `callerInfo, void `sharedPointer)

function prototypes and pointer type for single complex load

Return type: mufftComplex(*

Typedef mufftCallbackLoadZ

Definition: mufftXt.h (line 395)

typedef mufftDoubleComplex(` mufftCallbackLoadZ) (void `dataIn, size_t offset, void `callerInfo, void `sharedPointer)

function prototypes and pointer type for double complex load

Return type: mufftDoubleComplex(*

Typedef mufftCallbackLoadR

Definition: mufftXt.h (line 400)

typedef mufftReal(` mufftCallbackLoadR) (void `dataIn, size_t offset, void `callerInfo, void `sharedPointer)

function prototypes and pointer type for single real load

Return type: mufftReal(*

Typedef mufftCallbackLoadD

Definition: mufftXt.h (line 404)

typedef mufftDoubleReal(` mufftCallbackLoadD) (void `dataIn, size_t offset, void `callerInfo, void `sharedPointer)

function prototypes and pointer type for double real load

Return type: mufftDoubleReal(*

Typedef mufftCallbackStoreC

Definition: mufftXt.h (line 409)

typedef void(` mufftCallbackStoreC) (void `dataOut, size_t offset, mufftComplex element, void `callerInfo, void `sharedPointer)

function prototypes and pointer type for single complex store

Return type: void(*

Typedef mufftCallbackStoreZ

Definition: mufftXt.h (line 414)

typedef void(` mufftCallbackStoreZ) (void `dataOut, size_t offset, mufftDoubleComplex element, void `callerInfo, void `sharedPointer)

function prototypes and pointer type for double complex store

Return type: void(*

Typedef mufftCallbackStoreR

Definition: mufftXt.h (line 419)

typedef void(` mufftCallbackStoreR) (void `dataOut, size_t offset, mufftReal element, void `callerInfo, void `sharedPointer)

function prototypes and pointer type for single real store

Return type: void(*

Typedef mufftCallbackStoreD

Definition: mufftXt.h (line 424)

typedef void(` mufftCallbackStoreD) (void `dataOut, size_t offset, mufftDoubleReal element, void `callerInfo, void `sharedPointer)

function prototypes and pointer type for double real store

Return type: void(*

Functions

Function mufftXtSetGPUs

MUFFT_EXPORT mufftResult mufftXtSetGPUs(mufftHandle plan, int nGPUs, int *whichGPUs)

Set which GPUs are to be used with the plan.

Note that the call to mufftXtSetGPUs() must occur after the call to mufftCreate() and prior to the call to mufftMakePlan*(). Parameter whichGPUs of mufftXtSetGPUs() function determines ordering of the GPUs with respect to data decomposition.

Parameters:

  • plan: mufftHandle returned by mufftCreate
  • nGPUs: Number of GPUs to use.
  • whichGPUs: Pointer to the array of GPUs to use.

Return values:

  • MUFFT_SUCCESS: muFFT successfully set the GPUs to use.
  • MUFFT_INVALID_PLAN: The plan parameter is not a valid handle.
  • MUFFT_INVALID_VALUE: One or more invalid parameters were passed to the API.
  • MUFFT_INVALID_DEVICE: An invalid GPU index was specified.

Parameters:

Return type: MUFFT_EXPORT mufftResult

Function mufftXtMalloc

MUFFT_EXPORT mufftResult mufftXtMalloc(mufftHandle plan, musaLibXtDesc ``descriptor, mufftXtSubFormat format)

allocates a descriptor

mufftXtMalloc() allocates a descriptor, and all memory for data in GPUs associated with the plan, and returns a pointer to the descriptor. Note the descriptor contains an array of device pointers so that the application may preprocess or postprocess the data on the GPUs.

Parameters:

  • plan: mufftHandle returned by mufftCreate
  • descriptor: Pointer to a pointer to a musaLibXtDesc object.
  • format: mufftXtSubFormat value.

Return values:

  • MUFFT_SUCCESS: muFFT successfully allows user to allocate descriptor and GPU memory.
  • MUFFT_INVALID_PLAN: The plan parameter is not a valid handle or it is not a multiple GPU 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.

Parameters:

Return type: MUFFT_EXPORT mufftResult

Function mufftXtMemcpy

MUFFT_EXPORT mufftResult mufftXtMemcpy(mufftHandle plan, void `dstPointer, void `srcPointer, mufftXtCopyType type)

Copy data buffers.

mufftXtMemcpy() copies data between buffers on the host and GPUs or between GPUs. The enumerated parameter mufftXtCopyType indicates the type and direction of transfer.

Parameters:

  • plan: mufftHandle returned by mufftCreate
  • dstPointer: Pointer to the destination address.
  • srcPointer: Pointer to the source address.
  • type: mufftXtCopyType value.

Return values:

  • MUFFT_SUCCESS: muFFT successfully allows user to copy memory between host and GPUs or between GPUs.
  • MUFFT_INVALID_PLAN: The plan parameter is not a valid handle or it is not a multiple GPU plan.
  • MUFFT_INVALID_VALUE: One or more invalid parameters were passed to the API.
  • MUFFT_INTERNAL_ERROR: An internal driver error was detected.

Parameters:

Return type: MUFFT_EXPORT mufftResult

Function mufftXtFree

MUFFT_EXPORT mufftResult mufftXtFree(musaLibXtDesc *descriptor)

Frees the descriptor.

mufftXtFree() frees the descriptor and all memory associated with it. The descriptor and memory must have been returned by a previous call to mufftXtMalloc().

Parameters:

  • descriptor: Pointer to a musaLibXtDesc object.

Return values:

  • MUFFT_SUCCESS: muFFT successfully allows user to free descriptor and associated GPU memory.
  • MUFFT_INTERNAL_ERROR: An internal driver error was detected.

Parameters:

musaLibXtDesc descriptor

Return type: MUFFT_EXPORT mufftResult

Function mufftXtSetWorkArea

MUFFT_EXPORT mufftResult mufftXtSetWorkArea(mufftHandle plan, void ``workArea)

Set work area.

mufftXtSetWorkArea() overrides the work areas associated with a plan. If the work area was auto-allocated, cuFFT frees the auto-allocated space. The mufftXtExec*() calls assume that the work area is valid and that it points to a contiguous region in each device memory that does not overlap with any other work area. If this is not the case, results are indeterminate.

Parameters:

  • plan: mufftHandle returned by mufftCreate
  • workArea: Pointer to the pointers to workArea.

Return values:

  • MUFFT_SUCCESS: muFFT successfully set the work area to use.
  • MUFFT_INVALID_PLAN: The plan parameter is not a valid handle or it is not a multiple GPU plan.
  • MUFFT_INVALID_VALUE: One or more invalid parameters were passed to the API.
  • MUFFT_INTERNAL_ERROR: An internal driver error was detected.

Parameters:

Return type: MUFFT_EXPORT mufftResult

Function mufftXtExecDescriptorC2C

MUFFT_EXPORT mufftResult mufftXtExecDescriptorC2C(mufftHandle plan, musaLibXtDesc `input, musaLibXtDesc `output, int direction)

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

mufftXtExecDescriptorC2C() executes a single-precision complex-to-complex transform plan in the transform direction as specified by direction parameter. muFFT uses the GPU memory pointed to by musaLibXtDesc* as input and output data. Since only in-place multiple GPU functionality is supported, input and output should be the same pointer.

Parameters:

  • plan: mufftHandle returned by mufftCreate
  • input: Pointer to the input musaLibXtDesc object.
  • output: Pointer to the output musaLibXtDesc object.
  • direction: Transform direction: MUFFT_FORWARD or MUFFT_INVERSE.

Return values:

  • MUFFT_SUCCESS: muFFT successfully executed the FFT plan.
  • MUFFT_INVALID_PLAN: The plan parameter is not a valid handle or it is not a multiple GPU plan.
  • MUFFT_INVALID_VALUE: One or more invalid parameters were passed to the API.
  • MUFFT_INTERNAL_ERROR: An internal driver error was detected.
  • MUFFT_EXEC_FAILED: muFFT failed to execute the transform on the GPU.

Parameters:

  • mufftHandle plan musaLibXtDesc input musaLibXtDesc output
  • int direction

Return type: MUFFT_EXPORT mufftResult

Function mufftXtExecDescriptorR2C

MUFFT_EXPORT mufftResult mufftXtExecDescriptorR2C(mufftHandle plan, musaLibXtDesc `input, musaLibXtDesc `output)

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

mufftXtExecDescriptorR2C() executes a single-precision real-to-complex transform plan. muFFT uses the GPU memory pointed to by musaLibXtDesc* as input and output data. Since only in-place multiple GPU functionality is supported, input and output should be the same pointer.

Parameters:

  • plan: mufftHandle returned by mufftCreate
  • input: Pointer to the input musaLibXtDesc object.
  • output: Pointer to the output musaLibXtDesc object.

Return values:

  • MUFFT_SUCCESS: muFFT successfully executed the FFT plan.
  • MUFFT_INVALID_PLAN: The plan parameter is not a valid handle or it is not a multiple GPU plan.
  • MUFFT_INVALID_VALUE: One or more invalid parameters were passed to the API.
  • MUFFT_INTERNAL_ERROR: An internal driver error was detected.
  • MUFFT_EXEC_FAILED: muFFT failed to execute the transform on the GPU.

Parameters:

  • mufftHandle plan musaLibXtDesc input musaLibXtDesc output

Return type: MUFFT_EXPORT mufftResult

Function mufftXtExecDescriptorC2R

MUFFT_EXPORT mufftResult mufftXtExecDescriptorC2R(mufftHandle plan, musaLibXtDesc `input, musaLibXtDesc `output)

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

mufftXtExecDescriptorC2R() executes a single-precision complex-to-real transform plan. muFFT uses the GPU memory pointed to by musaLibXtDesc* as input and output data. Since only in-place multiple GPU functionality is supported, input and output should be the same pointer.

Parameters:

  • plan: mufftHandle returned by mufftCreate
  • input: Pointer to the input musaLibXtDesc object.
  • output: Pointer to the output musaLibXtDesc object.

Return values:

  • MUFFT_SUCCESS: muFFT successfully executed the FFT plan.
  • MUFFT_INVALID_PLAN: The plan parameter is not a valid handle or it is not a multiple GPU plan.
  • MUFFT_INVALID_VALUE: One or more invalid parameters were passed to the API.
  • MUFFT_INTERNAL_ERROR: An internal driver error was detected.
  • MUFFT_EXEC_FAILED: muFFT failed to execute the transform on the GPU.

Parameters:

  • mufftHandle plan musaLibXtDesc input musaLibXtDesc output

Return type: MUFFT_EXPORT mufftResult

Function mufftXtExecDescriptorZ2Z

MUFFT_EXPORT mufftResult mufftXtExecDescriptorZ2Z(mufftHandle plan, musaLibXtDesc `input, musaLibXtDesc `output, int direction)

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

mufftXtExecDescriptorZ2Z() executes a double-precision complex-to-complex transform plan in the transform direction as specified by direction parameter. muFFT uses the GPU memory pointed to by musaLibXtDesc* as input and output data. Since only in-place multiple GPU functionality is supported, input and output should be the same pointer.

Parameters:

  • plan: mufftHandle returned by mufftCreate
  • input: Pointer to the input musaLibXtDesc object.
  • output: Pointer to the output musaLibXtDesc object.
  • direction: Transform direction: MUFFT_FORWARD or MUFFT_INVERSE.

Return values:

  • MUFFT_SUCCESS: muFFT successfully executed the FFT plan.
  • MUFFT_INVALID_PLAN: The plan parameter is not a valid handle or it is not a multiple GPU plan.
  • MUFFT_INVALID_VALUE: One or more invalid parameters were passed to the API.
  • MUFFT_INTERNAL_ERROR: An internal driver error was detected.
  • MUFFT_EXEC_FAILED: muFFT failed to execute the transform on the GPU.

Parameters:

  • mufftHandle plan musaLibXtDesc input musaLibXtDesc output
  • int direction

Return type: MUFFT_EXPORT mufftResult

Function mufftXtExecDescriptorD2Z

MUFFT_EXPORT mufftResult mufftXtExecDescriptorD2Z(mufftHandle plan, musaLibXtDesc `input, musaLibXtDesc `output)

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

mufftXtExecDescriptorD2Z() executes a double-precision real-to-complex transform plan. muFFT uses the GPU memory pointed to by musaLibXtDesc* as input and output data. Since only in-place multiple GPU functionality is supported, input and output should be the same pointer.

Parameters:

  • plan: mufftHandle returned by mufftCreate
  • input: Pointer to the input musaLibXtDesc object.
  • output: Pointer to the output musaLibXtDesc object.

Return values:

  • MUFFT_SUCCESS: muFFT successfully executed the FFT plan.
  • MUFFT_INVALID_PLAN: The plan parameter is not a valid handle or it is not a multiple GPU plan.
  • MUFFT_INVALID_VALUE: One or more invalid parameters were passed to the API.
  • MUFFT_INTERNAL_ERROR: An internal driver error was detected.
  • MUFFT_EXEC_FAILED: muFFT failed to execute the transform on the GPU.

Parameters:

  • mufftHandle plan musaLibXtDesc input musaLibXtDesc output

Return type: MUFFT_EXPORT mufftResult

Function mufftXtExecDescriptorZ2D

MUFFT_EXPORT mufftResult mufftXtExecDescriptorZ2D(mufftHandle plan, musaLibXtDesc `input, musaLibXtDesc `output)

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

mufftXtExecDescriptorZ2D() executes a double-precision complex-to-real transform plan. muFFT uses the GPU memory pointed to by musaLibXtDesc* as input and output data. Since only in-place multiple GPU functionality is supported, input and output should be the same pointer.

Parameters:

  • plan: mufftHandle returned by mufftCreate
  • input: Pointer to the input musaLibXtDesc object.
  • output: Pointer to the output musaLibXtDesc object.

Return values:

  • MUFFT_SUCCESS: muFFT successfully executed the FFT plan.
  • MUFFT_INVALID_PLAN: The plan parameter is not a valid handle or it is not a multiple GPU plan.
  • MUFFT_INVALID_VALUE: One or more invalid parameters were passed to the API.
  • MUFFT_INTERNAL_ERROR: An internal driver error was detected.
  • MUFFT_EXEC_FAILED: muFFT failed to execute the transform on the GPU.

Parameters:

  • mufftHandle plan musaLibXtDesc input musaLibXtDesc output

Return type: MUFFT_EXPORT mufftResult

Function mufftXtQueryPlan

MUFFT_EXPORT mufftResult mufftXtQueryPlan(mufftHandle plan, void *queryStruct, mufftXtQueryType queryType)

Query plan.

mufftXtQueryPlan() allows the caller to retrieve a structure containing the number of strings, the decomposition factors, and (in the case of power of 2 size) some useful mask and shift elements. The result shows detals how to translate from an index in the host input array to the corresponding index on the device

Parameters:

  • plan: mufftHandle returned by mufftCreate
  • queryStruct: Pointer to the output object, only mufftXt1dFactors is supported.
  • queryType: mufftXtQueryType value.

Return values:

  • MUFFT_SUCCESS: muFFT successfully query FFT plan.
  • MUFFT_INVALID_PLAN: The plan parameter is not a valid handle or it is not a multiple GPU plan.
  • MUFFT_INVALID_VALUE: One or more invalid parameters were passed to the API.

Parameters:

Return type: MUFFT_EXPORT mufftResult

Function mufftXtSetCallback

MUFFT_EXPORT mufftResult mufftXtSetCallback(mufftHandle plan, void `callback_routine, mufftXtCallbackType cbType, void `caller_info)

Set callback.

mufftXtSetCallback() specifies a load or store callback to be used with the plan. This call is valid only after a call to mufftMakePlan*(), which does the plan generation. If there was already a callback of this type associated with the plan, this new callback routine replaces it. The callback requiring shared memory is not support yet. Not support for multi Gpu yet.

Parameters:

  • plan: mufftHandle returned by mufftCreate
  • callback_routine: Array of callback routine pointers, one per GPU.
  • cbType: Type of callback routine.
  • caller_info: Optional array of device pointers to caller specific information, one per GPU.

Return values:

  • MUFFT_SUCCESS: muFFT successfully associated the callback function with the plan.
  • MUFFT_INVALID_PLAN: The plan parameter is not a valid handle.
  • MUFFT_INVALID_TYPE: Invalid callback type.
  • MUFFT_INTERNAL_ERROR: An internal driver error was detected.

Parameters:

Return type: MUFFT_EXPORT mufftResult

Function mufftXtClearCallback

MUFFT_EXPORT mufftResult mufftXtClearCallback(mufftHandle plan, mufftXtCallbackType cbType)

Clear callback.

mufftXtSetCallback() instructs muFFT to stop invoking the specified callback type when executing the plan. Only the specified callback is cleared. If no callback of this type had been specified, the return code is MUFFT_SUCCESS.

Parameters:

  • plan: mufftHandle returned by mufftCreate
  • cbType: Type of callback routine.

Return values:

  • MUFFT_SUCCESS: muFFT successfully associated the callback function with the plan.
  • MUFFT_INVALID_PLAN: The plan parameter is not a valid handle.
  • MUFFT_INVALID_TYPE: Invalid callback type.
  • MUFFT_INTERNAL_ERROR: An internal driver error was detected.

Parameters:

Return type: MUFFT_EXPORT mufftResult

Function mufftXtMakePlanMany

MUFFT_EXPORT mufftResult mufftXtMakePlanMany(mufftHandle plan, int rank, long long int `n, long long int `inembed, long long int istride, long long int idist, musaDataType inputtype, long long int `onembed, long long int ostride, long long int odist, musaDataType outputtype, long long int batch, size_t `workSize, musaDataType executiontype)

Set callback share memory size.

mufftXtSetCallbackSharedSize() instructs muFFT to dynamically allocate shared memory at launch time, for use by the callback. The maximum allowable amount of shared memory is 16K bytes. muFFT passes a pointer to this shared memory to the callback routine at execution time. This shared memory is only valid for the life of the load or store callback operation. During execution, muFFT may overwrite shared memory for its own purposes.

Parameters:

  • plan: mufftHandle returned by mufftCreate
  • cbType: Type of callback routine.
  • sharedSize: Amount of shared memory requested.

Return values:

  • MUFFT_SUCCESS: muFFT will invoke the callback routine with a pointer to the requested amount of shared memory.
  • MUFFT_INVALID_PLAN: The plan parameter is not a valid handle.
  • MUFFT_INVALID_VALUE: One or more invalid parameters were passed to the API.
  • MUFFT_INVALID_TYPE: Invalid callback type.
  • MUFFT_INTERNAL_ERROR: An internal driver error was detected. `&zwj/ MUFFT_EXPORT mufftResult mufftXtSetCallbackSharedSize( mufftHandle plan, mufftXtCallbackType cbType, size_t sharedSize);

/*! Initialize a new batched rank-dimensional FFT plan.

@details mufftCreate() makes an FFT plan configuration of dimension rank,

with sizes specified in the array n. The batch input parameter tells muFFT how many transforms to configure. With this function, batched plans of 1, 2, or 3 dimensions may be created. Type specifiers inputtype, outputtype and executiontype dictate type and precision of transform to be performed. Not all combinations of parameters are supported. Currently all three parameters need to match precision. Parameters inputtype and outputtype need to match transform type complex-to-complex, real-to-complex or complex-to-real. Parameter executiontype needs to match precision and be of a complex type. Example: for a half-precision real-to-complex transform, parameters inputtype, outputtype and executiontype would have values of MUSA_R_16F, MUSA_C_16F and MUSA_C_16F respectively. Similarly, a bfloat16 complex-to-real transform would use MUSA_C_16BF for inputtype and executiontype, and MUSA_R_16BF for outputtype. The mufftXtMakePlanMany() API supports more complicated input and output data layouts via the advanced data layout parameters: inembed, istride, idist, onembed, ostride, and odist. If inembed and onembed are set to NULL, all other stride information is ignored, and default strides are used. The default assumes contiguous data arrays. If mufftXtSetGPUs() was called prior to this call with multiple GPUs, then workSize will contain multiple sizes. See sections on multiple GPUs for more details. All arrays are assumed to be in CPU memory.

Parameters:

  • plan: Pointer to the FFT plan handle.
  • rank: Dimension of FFT transform (1, 2, or 3).
  • n: Number of elements in the x/y/z directions.
  • 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.
  • istride: Indicates the distance between two successive input elements in the least significant (i.e., innermost) dimension.
  • idist: Distance between input batches.
  • inputtype: Type of input data.
  • 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.
  • ostride: Indicates the distance between two successive output elements in the output array in the least significant (i.e., innermost) dimension.
  • odist: Distance between output batches.
  • outputtype: Type of output data.
  • batch: Number of batched transforms to perform.
  • workSize: Pointer to work area size.
  • executiontype: Type of data to be used for computations.

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_INTERNAL_ERROR: An internal driver error was detected.
  • MUFFT_INVALID_SIZE: One or more of the parameters is not a supported size.

Parameters:

  • mufftHandle plan
  • int rank long long int n long long int inembed
  • long long int istride
  • long long int idist
  • musaDataType inputtype long long int onembed
  • long long int ostride
  • long long int odist
  • musaDataType outputtype
  • long long int batch size_t workSize
  • musaDataType executiontype

Return type: MUFFT_EXPORT mufftResult

Function mufftXtGetSizeMany

MUFFT_EXPORT mufftResult mufftXtGetSizeMany(mufftHandle plan, int rank, long long int `n, long long int `inembed, long long int istride, long long int idist, musaDataType inputtype, long long int `onembed, long long int ostride, long long int odist, musaDataType outputtype, long long int batch, size_t `workSize, musaDataType executiontype)

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

mufftXtGetSizeMany() gives the specified parameters that match signature of mufftXtMakePlanMany function, and taking into account any plan settings that may have been made. For more information about valid combinations of inputtype, outputtype and executiontype parameters please refer to documentation of mufftXtMakePlanMany function.

Parameters:

  • plan: Pointer to the FFT plan handle.
  • rank: Dimension of FFT transform (1, 2, or 3).
  • n: Number of elements in the x/y/z directions.
  • 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.
  • istride: Indicates the distance between two successive input elements in the least significant (i.e., innermost) dimension.
  • idist: Distance between input batches.
  • inputtype: Type of input data.
  • 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.
  • ostride: Indicates the distance between two successive output elements in the output array in the least significant (i.e., innermost) dimension.
  • odist: Distance between output batches.
  • outputtype: Type of output data.
  • batch: Number of batched transforms to perform.
  • workSize: Pointer to work area size.
  • executiontype: Type of data to be used for computations.

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_INTERNAL_ERROR: An internal driver error was detected.
  • MUFFT_INVALID_SIZE: One or more of the parameters is not a supported size.

Parameters:

  • mufftHandle plan
  • int rank long long int n long long int inembed
  • long long int istride
  • long long int idist
  • musaDataType inputtype long long int onembed
  • long long int ostride
  • long long int odist
  • musaDataType outputtype
  • long long int batch size_t workSize
  • musaDataType executiontype

Return type: MUFFT_EXPORT mufftResult

Function mufftXtExec

MUFFT_EXPORT mufftResult mufftXtExec(mufftHandle plan, void `input, void `output, int direction)

Execute FFT.

Function mufftXtExec() executes any muFFT transform regardless of precision and type. In case of complex-to-real and real-to-complex transforms direction parameter is ignored. muFFT uses the GPU memory pointed to by the input parameter as input data. This function stores the Fourier coefficients in the output array. If input and output are the same, this method does an in-place transform.

Parameters:

  • plan: The FFT plan.
  • input: Input data (on device).
  • output: Output data (on device).
  • direction: Either MUFFT_FORWARD or MUFFT_INVERSE.

Return values:

  • MUFFT_SUCCESS: muFFT successfully executed the FFT plan.
  • MUFFT_INVALID_PLAN: The plan parameter is not a valid handle.
  • MUFFT_INVALID_VALUE: One or more invalid parameters were passed to the API.
  • MUFFT_EXEC_FAILED: muFFT failed to execute the transform on the GPU.

Parameters:

  • mufftHandle plan void input void output
  • int direction

Return type: MUFFT_EXPORT mufftResult

Function mufftXtExecDescriptor

MUFFT_EXPORT mufftResult mufftXtExecDescriptor(mufftHandle plan, musaLibXtDesc `input, musaLibXtDesc `output, int direction)

Execute Multi Gpu FFT.

Function ufftXtExecDescriptor() executes any muFFT transform regardless of precision and type. In case of complex-to-real and real-to-complex transforms direction parameter is ignored. muFFT uses the GPU memory pointed to by musaLibXtDesc input descriptor as input data and musaLibXtDesc output as output data. Since only in-place multiple GPU functionality is supported, input and output should be the same pointer.

Parameters:

  • plan: The FFT plan.
  • input: Pointer to the input musaLibXtDesc object.
  • output: Pointer to the output musaLibXtDesc object.
  • direction: Either MUFFT_FORWARD or MUFFT_INVERSE.

Return values:

  • MUFFT_SUCCESS: muFFT successfully executed the FFT plan.
  • MUFFT_INVALID_PLAN: The plan parameter is not a valid handle.
  • MUFFT_INVALID_VALUE: One or more invalid parameters were passed to the API.
  • MUFFT_INTERNAL_ERROR: An internal driver error was detected.
  • MUFFT_EXEC_FAILED: muFFT failed to execute the transform on the GPU.

Parameters:

  • mufftHandle plan musaLibXtDesc input musaLibXtDesc output
  • int direction

Return type: MUFFT_EXPORT mufftResult

Function mufftXtSetWorkAreaPolicy

MUFFT_EXPORT mufftResult mufftXtSetWorkAreaPolicy(mufftHandle plan, mufftXtWorkAreaPolicy policy, size_t *workSize)

Set workarea policy.

mufftXtSetWorkAreaPolicy() indicates that the caller intends to change work area size for a given plan handle. muFFT’s default behavior is to allocate the work area at plan generation time with a default size that depends on the plan type and other parameters. If mufftXtSetWorkAreaPolicy() has been called with the policy parameter set to MUFFT_WORKAREA_MINIMAL, muFFT will attempt to re-plan the handle to use zero bytes of work area memory. If the mufftXtSetWorkAreaPolicy() call is successful the auto-allocated work area memory is released.

Parameters:

  • plan: The FFT plan.
  • policy: Type of work area policy to apply.
  • workSize: Reserved for future use.

Return values:

  • MUFFT_SUCCESS: muFFT successfully set the work policy.
  • MUFFT_INVALID_PLAN: The plan parameter is not a valid handle.
  • MUFFT_INVALID_VALUE: One or more invalid parameters were passed to the API.
  • MUFFT_INTERNAL_ERROR: An internal driver error was detected.

Parameters:

Return type: MUFFT_EXPORT mufftResult

Function mufftXtSetDistribution

MUFFT_EXPORT mufftResult mufftXtSetDistribution(mufftHandle plan, int rank, const long long int `lower_input, const long long int `upper_input, const long long int `lower_output, const long long int `upper_output, const long long int `strides_input, const long long int `strides_output)

Parameters:

  • mufftHandle plan
  • int rank const long long int lower_input const long long int upper_input const long long int lower_output const long long int upper_output const long long int strides_input const long long int strides_output

Return type: MUFFT_EXPORT mufftResult


Structure mufftXt1dFactors_t

Definition: mufftXt.h (line 86)

The return struct of query for mufftXtQueryPlan.

Members

Attributes

Member size

Definition: mufftXt.h (line 87)

long long int size

Type: long long int

Member stringCount

Definition: mufftXt.h (line 88)

long long int stringCount

Type: long long int

Member stringLength

Definition: mufftXt.h (line 89)

long long int stringLength

Type: long long int

Member substringLength

Definition: mufftXt.h (line 90)

long long int substringLength

Type: long long int

Member factor1

Definition: mufftXt.h (line 91)

long long int factor1

Type: long long int

Member factor2

Definition: mufftXt.h (line 92)

long long int factor2

Type: long long int

Member stringMask

Definition: mufftXt.h (line 93)

long long int stringMask

Type: long long int

Member substringMask

Definition: mufftXt.h (line 94)

long long int substringMask

Type: long long int

Member factor1Mask

Definition: mufftXt.h (line 95)

long long int factor1Mask

Type: long long int

Member factor2Mask

Definition: mufftXt.h (line 96)

long long int factor2Mask

Type: long long int

Member stringShift

Definition: mufftXt.h (line 97)

int stringShift

Type: int

Member substringShift

Definition: mufftXt.h (line 98)

int substringShift

Type: int

Member factor1Shift

Definition: mufftXt.h (line 99)

int factor1Shift

Type: int

Member factor2Shift

Definition: mufftXt.h (line 100)

int factor2Shift

Type: int


Structures


Index of Structures

M


Structure mufftXt1dFactors_t

Definition: mufftXt.h (line 86)

The return struct of query for mufftXtQueryPlan.

Members

Attributes

Member size

Definition: mufftXt.h (line 87)

long long int size

Type: long long int

Member stringCount

Definition: mufftXt.h (line 88)

long long int stringCount

Type: long long int

Member stringLength

Definition: mufftXt.h (line 89)

long long int stringLength

Type: long long int

Member substringLength

Definition: mufftXt.h (line 90)

long long int substringLength

Type: long long int

Member factor1

Definition: mufftXt.h (line 91)

long long int factor1

Type: long long int

Member factor2

Definition: mufftXt.h (line 92)

long long int factor2

Type: long long int

Member stringMask

Definition: mufftXt.h (line 93)

long long int stringMask

Type: long long int

Member substringMask

Definition: mufftXt.h (line 94)

long long int substringMask

Type: long long int

Member factor1Mask

Definition: mufftXt.h (line 95)

long long int factor1Mask

Type: long long int

Member factor2Mask

Definition: mufftXt.h (line 96)

long long int factor2Mask

Type: long long int

Member stringShift

Definition: mufftXt.h (line 97)

int stringShift

Type: int

Member substringShift

Definition: mufftXt.h (line 98)

int substringShift

Type: int

Member factor1Shift

Definition: mufftXt.h (line 99)

int factor1Shift

Type: int

Member factor2Shift

Definition: mufftXt.h (line 100)

int factor2Shift

Type: int