clFFT.h 2.16 KB
Newer Older
Gaurav Khanna's avatar
Gaurav Khanna committed
1
2
#ifndef __CLFFT_H 
#define __CLFFT_H 
3
4
5
6
7
8

#ifdef __APPLE__  
	#include <OpenCL/cl.h> 
#else
	#include <CL/cl.h> 
#endif
9
10
11
12
  
#ifdef __cplusplus 
extern "C" { 
#endif 
13

Gaurav Khanna's avatar
Gaurav Khanna committed
14
15
16
17
18
19
20
21
22
#include <stdio.h> 
  
// XForm type 
typedef enum  
{ 
    clFFT_Forward   =   -1, 
    clFFT_Inverse   =    1 
     
}clFFT_Direction; 
23

Gaurav Khanna's avatar
Gaurav Khanna committed
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// XForm dimension 
typedef enum 
{ 
    clFFT_1D    = 0, 
    clFFT_2D    = 1, 
    clFFT_3D    = 3 
     
}clFFT_Dimension; 
  
// XForm Data type 
typedef enum 
{ 
    clFFT_SplitComplexFormat       = 0, 
    clFFT_InterleavedComplexFormat = 1 
}clFFT_DataFormat; 
  
typedef struct 
{ 
    unsigned int x; 
    unsigned int y; 
    unsigned int z; 
}clFFT_Dim3;     
     
typedef struct 
{ 
    float *real; 
    float *imag; 
} clFFT_SplitComplex; 
  
typedef struct 
{ 
    float real; 
    float imag; 
}clFFT_Complex; 
  
typedef void* clFFT_Plan;    
  
clFFT_Plan clFFT_CreatePlan( cl_context context, clFFT_Dim3 n, clFFT_Dimension dim, clFFT_DataFormat dataFormat, cl_int *error_code ); 
  
void clFFT_DestroyPlan( clFFT_Plan plan ); 
  
cl_int clFFT_ExecuteInterleaved( cl_command_queue queue, clFFT_Plan plan, cl_int batchSize, clFFT_Direction dir,  
                                 cl_mem data_in, cl_mem data_out, 
                                 cl_int num_events, cl_event *event_list, cl_event *event ); 
  
cl_int clFFT_ExecutePlannar( cl_command_queue queue, clFFT_Plan plan, cl_int batchSize, clFFT_Direction dir,  
                             cl_mem data_in_real, cl_mem data_in_imag, cl_mem data_out_real, cl_mem data_out_imag, 
                             cl_int num_events, cl_event *event_list, cl_event *event ); 
  
cl_int clFFT_1DTwistInterleaved(clFFT_Plan Plan, cl_command_queue queue, cl_mem array,  
                                size_t numRows, size_t numCols, size_t startRow, size_t rowsToProcess, clFFT_Direction dir); 
     
  
cl_int clFFT_1DTwistPlannar(clFFT_Plan Plan, cl_command_queue queue, cl_mem array_real, cl_mem array_imag,  
                            size_t numRows, size_t numCols, size_t startRow, size_t rowsToProcess, clFFT_Direction dir); 
     
void clFFT_DumpPlan( clFFT_Plan plan, FILE *file);   
  
#ifdef __cplusplus 
} 
#endif 
  
#endif