Go to the documentation of this file.
27 #if !defined( CLFFT_H )
30 #if defined(__APPLE__) || defined(__MACOSX)
31 #include <OpenCL/cl.h>
36 #include "clFFT.version.h"
46 #if !defined( __cplusplus )
47 #define inline __inline
50 #if defined( CLFFT_STATIC )
52 #elif defined( CLFFT_EXPORTS )
53 #define CLFFTAPI __declspec( dllexport )
55 #define CLFFTAPI __declspec( dllimport )
76 CLFFT_INVALID_GLOBAL_WORK_SIZE = CL_INVALID_GLOBAL_WORK_SIZE,
77 CLFFT_INVALID_MIP_LEVEL = CL_INVALID_MIP_LEVEL,
78 CLFFT_INVALID_BUFFER_SIZE = CL_INVALID_BUFFER_SIZE,
79 CLFFT_INVALID_GL_OBJECT = CL_INVALID_GL_OBJECT,
80 CLFFT_INVALID_OPERATION = CL_INVALID_OPERATION,
81 CLFFT_INVALID_EVENT = CL_INVALID_EVENT,
82 CLFFT_INVALID_EVENT_WAIT_LIST = CL_INVALID_EVENT_WAIT_LIST,
83 CLFFT_INVALID_GLOBAL_OFFSET = CL_INVALID_GLOBAL_OFFSET,
84 CLFFT_INVALID_WORK_ITEM_SIZE = CL_INVALID_WORK_ITEM_SIZE,
85 CLFFT_INVALID_WORK_GROUP_SIZE = CL_INVALID_WORK_GROUP_SIZE,
86 CLFFT_INVALID_WORK_DIMENSION = CL_INVALID_WORK_DIMENSION,
87 CLFFT_INVALID_KERNEL_ARGS = CL_INVALID_KERNEL_ARGS,
88 CLFFT_INVALID_ARG_SIZE = CL_INVALID_ARG_SIZE,
89 CLFFT_INVALID_ARG_VALUE = CL_INVALID_ARG_VALUE,
90 CLFFT_INVALID_ARG_INDEX = CL_INVALID_ARG_INDEX,
91 CLFFT_INVALID_KERNEL = CL_INVALID_KERNEL,
92 CLFFT_INVALID_KERNEL_DEFINITION = CL_INVALID_KERNEL_DEFINITION,
93 CLFFT_INVALID_KERNEL_NAME = CL_INVALID_KERNEL_NAME,
94 CLFFT_INVALID_PROGRAM_EXECUTABLE = CL_INVALID_PROGRAM_EXECUTABLE,
95 CLFFT_INVALID_PROGRAM = CL_INVALID_PROGRAM,
96 CLFFT_INVALID_BUILD_OPTIONS = CL_INVALID_BUILD_OPTIONS,
97 CLFFT_INVALID_BINARY = CL_INVALID_BINARY,
98 CLFFT_INVALID_SAMPLER = CL_INVALID_SAMPLER,
99 CLFFT_INVALID_IMAGE_SIZE = CL_INVALID_IMAGE_SIZE,
100 CLFFT_INVALID_IMAGE_FORMAT_DESCRIPTOR = CL_INVALID_IMAGE_FORMAT_DESCRIPTOR,
101 CLFFT_INVALID_MEM_OBJECT = CL_INVALID_MEM_OBJECT,
102 CLFFT_INVALID_HOST_PTR = CL_INVALID_HOST_PTR,
103 CLFFT_INVALID_COMMAND_QUEUE = CL_INVALID_COMMAND_QUEUE,
104 CLFFT_INVALID_QUEUE_PROPERTIES = CL_INVALID_QUEUE_PROPERTIES,
105 CLFFT_INVALID_CONTEXT = CL_INVALID_CONTEXT,
106 CLFFT_INVALID_DEVICE = CL_INVALID_DEVICE,
107 CLFFT_INVALID_PLATFORM = CL_INVALID_PLATFORM,
108 CLFFT_INVALID_DEVICE_TYPE = CL_INVALID_DEVICE_TYPE,
109 CLFFT_INVALID_VALUE = CL_INVALID_VALUE,
110 CLFFT_MAP_FAILURE = CL_MAP_FAILURE,
111 CLFFT_BUILD_PROGRAM_FAILURE = CL_BUILD_PROGRAM_FAILURE,
112 CLFFT_IMAGE_FORMAT_NOT_SUPPORTED = CL_IMAGE_FORMAT_NOT_SUPPORTED,
113 CLFFT_IMAGE_FORMAT_MISMATCH = CL_IMAGE_FORMAT_MISMATCH,
114 CLFFT_MEM_COPY_OVERLAP = CL_MEM_COPY_OVERLAP,
115 CLFFT_PROFILING_INFO_NOT_AVAILABLE = CL_PROFILING_INFO_NOT_AVAILABLE,
116 CLFFT_OUT_OF_HOST_MEMORY = CL_OUT_OF_HOST_MEMORY,
117 CLFFT_OUT_OF_RESOURCES = CL_OUT_OF_RESOURCES,
118 CLFFT_MEM_OBJECT_ALLOCATION_FAILURE = CL_MEM_OBJECT_ALLOCATION_FAILURE,
119 CLFFT_COMPILER_NOT_AVAILABLE = CL_COMPILER_NOT_AVAILABLE,
120 CLFFT_DEVICE_NOT_AVAILABLE = CL_DEVICE_NOT_AVAILABLE,
121 CLFFT_DEVICE_NOT_FOUND = CL_DEVICE_NOT_FOUND,
122 CLFFT_SUCCESS = CL_SUCCESS,
138 typedef enum clfftDim_
147 typedef enum clfftLayout_
159 typedef enum clfftPrecision_
169 typedef enum clfftDirection_
179 typedef enum clfftResultLocation_
188 typedef enum clfftResultTransposed_ {
195 #define CLFFT_DUMP_PROGRAMS 0x1
218 typedef enum clfftCallbackType_
237 setupData->major = clfftVersionMajor;
238 setupData->minor = clfftVersionMinor;
239 setupData->patch = clfftVersionPatch;
240 setupData->debugFlags = 0;
242 return CLFFT_SUCCESS;
278 const size_t* clLengths );
315 void (CL_CALLBACK *pfn_notify)(
clfftPlanHandle plHandle,
void *user_data),
void* user_data );
566 int localMemSize,
clfftCallbackType callbackType, cl_mem *userdata,
int numUserdataBuffers);
594 cl_uint numQueuesAndEvents,
595 cl_command_queue* commQueues,
596 cl_uint numWaitEvents,
597 const cl_event* waitEvents,
599 cl_mem* inputBuffers,
600 cl_mem* outputBuffers,
clfftPrecision
Specify the expected precision of each FFT.
Definition: clFFT.h:159
CLFFTAPI clfftStatus clfftSetPlanDim(clfftPlanHandle plHandle, const clfftDim dim)
Set the dimensionality of the data that is transformed.
cl_ulong debugFlags
Definition: clFFT.h:209
clfftResultLocation
Specify wheter the input buffers are overwritten with results.
Definition: clFFT.h:179
CLFFTAPI clfftStatus clfftSetResultLocation(clfftPlanHandle plHandle, clfftResultLocation placeness)
Set whether the input buffers are to be overwritten with results.
CLFFTAPI clfftStatus clfftGetPlanInStride(const clfftPlanHandle plHandle, const clfftDim dim, size_t *clStrides)
Retrieve the distance between consecutive elements of input buffers in each dimension.
__inline clfftStatus clfftInitSetupData(clfftSetupData *setupData)
Initialize a clfftSetupData struct for the client.
Definition: clFFT.h:235
clfftDirection
Specify the expected direction of each FFT, time or the frequency domains.
Definition: clFFT.h:169
cl_uint major
Definition: clFFT.h:204
CLFFTAPI clfftStatus clfftSetLayout(clfftPlanHandle plHandle, clfftLayout iLayout, clfftLayout oLayout)
Set the expected layout of the input and output buffers.
cl_uint patch
Definition: clFFT.h:206
CLFFTAPI clfftStatus clfftCopyPlan(clfftPlanHandle *out_plHandle, cl_context new_context, clfftPlanHandle in_plHandle)
Create a copy of an existing plan.
CLFFTAPI clfftStatus clfftGetPlanDim(const clfftPlanHandle plHandle, clfftDim *dim, cl_uint *size)
Retrieve the dimensionality of the data that is transformed.
CLFFTAPI clfftStatus clfftGetPlanLength(const clfftPlanHandle plHandle, const clfftDim dim, size_t *clLengths)
Retrieve the length of each dimension of the FFT.
CLFFTAPI clfftStatus clfftGetPlanBatchSize(const clfftPlanHandle plHandle, size_t *batchSize)
Retrieve the number of discrete arrays that the plan can concurrently handle.
clfftLayout
Specify the expected layouts of the buffers.
Definition: clFFT.h:147
CLFFTAPI clfftStatus clfftGetPlanPrecision(const clfftPlanHandle plHandle, clfftPrecision *precision)
Retrieve the floating point precision of the FFT data.
CLFFTAPI clfftStatus clfftGetTmpBufSize(const clfftPlanHandle plHandle, size_t *buffersize)
Get buffer size (in bytes), which may be needed internally for an intermediate buffer.
CLFFTAPI clfftStatus clfftSetPlanInStride(clfftPlanHandle plHandle, const clfftDim dim, size_t *clStrides)
Set the distance between consecutive elements of input buffers in each dimension.
cl_uint minor
Definition: clFFT.h:205
CLFFTAPI clfftStatus clfftEnqueueTransform(clfftPlanHandle plHandle, clfftDirection dir, cl_uint numQueuesAndEvents, cl_command_queue *commQueues, cl_uint numWaitEvents, const cl_event *waitEvents, cl_event *outEvents, cl_mem *inputBuffers, cl_mem *outputBuffers, cl_mem tmpBuffer)
Enqueue an FFT transform operation, and return immediately (non-blocking)
CLFFTAPI clfftStatus clfftGetPlanContext(const clfftPlanHandle plHandle, cl_context *context)
Retrieve the OpenCL context of a previously created plan.
clfftStatus_
clfft error codes definition(incorporating OpenCL error definitions)
Definition: clFFT.h:74
CLFFTAPI clfftStatus clfftGetPlanScale(const clfftPlanHandle plHandle, clfftDirection dir, cl_float *scale)
Retrieve the scaling factor that is applied to the FFT data.
CLFFTAPI clfftStatus clfftGetLayout(const clfftPlanHandle plHandle, clfftLayout *iLayout, clfftLayout *oLayout)
Retrieve the expected layout of the input and output buffers.
CLFFTAPI clfftStatus clfftSetPlanOutStride(clfftPlanHandle plHandle, const clfftDim dim, size_t *clStrides)
Set the distance between consecutive elements of output buffers in a dimension.
size_t clfftPlanHandle
An abstract handle to the object that represents the state of the FFT(s)
Definition: clFFT.h:225
CLFFTAPI clfftStatus clfftGetVersion(cl_uint *major, cl_uint *minor, cl_uint *patch)
Query the FFT library for version information.
CLFFTAPI clfftStatus clfftGetPlanTransposeResult(const clfftPlanHandle plHandle, clfftResultTransposed *transposed)
Retrieve the final transpose setting of a multi-dimensional FFT.
clfftResultTransposed
Determines whether the result is returned in original order. It is valid only for dimensions greater ...
Definition: clFFT.h:188
clfftDim
The dimension of the input and output buffers that is fed into all FFT transforms.
Definition: clFFT.h:138
CLFFTAPI clfftStatus clfftDestroyPlan(clfftPlanHandle *plHandle)
Release the resources of a plan.
CLFFTAPI clfftStatus clfftSetPlanPrecision(clfftPlanHandle plHandle, clfftPrecision precision)
Set the floating point precision of the FFT data.
CLFFTAPI clfftStatus clfftGetResultLocation(const clfftPlanHandle plHandle, clfftResultLocation *placeness)
Retrieve whether the input buffers are to be overwritten with results.
CLFFTAPI clfftStatus clfftSetPlanTransposeResult(clfftPlanHandle plHandle, clfftResultTransposed transposed)
Set the final transpose setting of a multi-dimensional FFT.
clfftCallbackType
Type of Callback function.
Definition: clFFT.h:218
CLFFTAPI clfftStatus clfftSetup(const clfftSetupData *setupData)
Initialize the internal FFT resources.
Data structure that can be passed to clfftSetup() to control the behavior of the FFT runtime.
Definition: clFFT.h:202
CLFFTAPI clfftStatus clfftBakePlan(clfftPlanHandle plHandle, cl_uint numQueues, cl_command_queue *commQueueFFT, void(CL_CALLBACK *pfn_notify)(clfftPlanHandle plHandle, void *user_data), void *user_data)
Prepare the plan for execution.
CLFFTAPI clfftStatus clfftTeardown()
Release all internal resources.
CLFFTAPI clfftStatus clfftCreateDefaultPlan(clfftPlanHandle *plHandle, cl_context context, const clfftDim dim, const size_t *clLengths)
Create a plan object initialized entirely with default values.
CLFFTAPI clfftStatus clfftGetPlanDistance(const clfftPlanHandle plHandle, size_t *iDist, size_t *oDist)
Retrieve the distance between array objects.
CLFFTAPI clfftStatus clfftSetPlanLength(clfftPlanHandle plHandle, const clfftDim dim, const size_t *clLengths)
Set the length of each dimension of the FFT.
CLFFTAPI clfftStatus clfftSetPlanBatchSize(clfftPlanHandle plHandle, size_t batchSize)
Set the number of discrete arrays that the plan can concurrently handle.
CLFFTAPI clfftStatus clfftSetPlanScale(clfftPlanHandle plHandle, clfftDirection dir, cl_float scale)
Set the scaling factor that is applied to the FFT data.
CLFFTAPI clfftStatus clfftSetPlanCallback(clfftPlanHandle plHandle, const char *funcName, const char *funcString, int localMemSize, clfftCallbackType callbackType, cl_mem *userdata, int numUserdataBuffers)
Register the callback parameters.
#define CLFFTAPI
Definition: clFFT.h:58
CLFFTAPI clfftStatus clfftGetPlanOutStride(const clfftPlanHandle plHandle, const clfftDim dim, size_t *clStrides)
Retrieve the distance between consecutive elements of output buffers in each dimension.
CLFFTAPI clfftStatus clfftSetPlanDistance(clfftPlanHandle plHandle, size_t iDist, size_t oDist)
Set the distance between array objects.