-
Notifications
You must be signed in to change notification settings - Fork 18
/
cfftw++.h
206 lines (190 loc) · 11.7 KB
/
cfftw++.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
/* cfftw++.h - C callable FFTW++ wrapper
*
* Not all of the FFTW++ routines are wrapped.
*
* Authors:
* Matthew Emmett <[email protected]> and
* Malcolm Roberts <[email protected]>
*/
#ifndef _CFFTWPP_H_
#define _CFFTWPP_H_
#ifdef __cplusplus
namespace fftwpp { extern "C" {
#endif
// wrappers for allocating aligned memory arrays
double *create_doublealign(size_t n);
void delete_complexAlign(double __complex__ * p);
double __complex__ *create_complexAlign(size_t n);
void delete_complexAlign(double __complex__ * p);
// wrappers for multiple threads
size_t get_fftwpp_maxthreads();
void set_fftwpp_maxthreads(size_t nthreads);
// 1d complex non-centered convolution
typedef struct HybridConvolution HybridConvolution;
HybridConvolution *fftwpp_create_conv1d(size_t nx);
HybridConvolution *fftwpp_create_conv1d_dot(size_t m,
size_t M);
HybridConvolution *fftwpp_create_conv1d_work(size_t m,
double __complex__ *u,
double __complex__ *v);
HybridConvolution *fftwpp_create_conv1d_work_dot(size_t m,
double __complex__ *u,
double __complex__ *v,
size_t M);
void fftwpp_conv1d_convolve(HybridConvolution *conv,
double __complex__ *a, double __complex__ *b);
void fftwpp_conv1d_convolve_dot(HybridConvolution *conv,
double __complex__ **a,
double __complex__ **b);
void fftwpp_conv1d_convolve_dotf(HybridConvolution *conv,
double __complex__ *a,
double __complex__ *b);
void fftwpp_conv1d_delete(HybridConvolution *conv);
// 1d Hermitian-symmetric entered convolution/
typedef struct HybridConvolutionHermitian HybridConvolutionHermitian;
HybridConvolutionHermitian *fftwpp_create_hconv1d(size_t m);
HybridConvolutionHermitian *fftwpp_create_hconv1d_dot(size_t m,
size_t M);
HybridConvolutionHermitian *fftwpp_create_hconv1d_work(size_t m,
double __complex__ *u,
double __complex__ *v,
double __complex__ *w);
HybridConvolutionHermitian *fftwpp_create_hconv1d_work_dot(size_t m,
double __complex__ *u,
double __complex__ *v,
double __complex__ *w,
size_t M);
void fftwpp_hconv1d_convolve(HybridConvolutionHermitian *conv,
double __complex__ *a, double __complex__ *b);
void fftwpp_hconv1d_convolve_dot(HybridConvolutionHermitian *conv,
double __complex__ **a,
double __complex__ **b);
void fftwpp_hconv1d_convolve_dotf(HybridConvolutionHermitian *conv,
double __complex__ *a,
double __complex__ *b);
void fftwpp_hconv1d_delete(HybridConvolutionHermitian *conv);
// 2d complex non-centered convolution
typedef struct HybridConvolution2 HybridConvolution2;
HybridConvolution2 *fftwpp_create_conv2d(size_t mx, size_t my);
HybridConvolution2 *fftwpp_create_conv2d_dot(size_t mx, size_t my,
size_t M);
HybridConvolution2 *fftwpp_create_conv2d_work(size_t mx,
size_t my,
double __complex__ *u1,
double __complex__ *v1,
double __complex__ *u2,
double __complex__ *v2);
HybridConvolution2 *fftwpp_create_conv2d_work_dot(size_t mx,
size_t my,
double __complex__ *u1,
double __complex__ *v1,
double __complex__ *u2,
double __complex__ *v2,
size_t M);
void fftwpp_conv2d_convolve(HybridConvolution2 *conv,
double __complex__ *a, double __complex__ *b);
void fftwpp_conv2d_convolve_dot(HybridConvolution2 *conv,
double __complex__ **a, double __complex__ **b);
void fftwpp_conv2d_convolve_dotf(HybridConvolution2 *conv,
double __complex__ *a, double __complex__ *b);
void fftwpp_conv2d_delete(HybridConvolution2 *conv);
// 2d Hermitian-symmetric centered convolution
typedef struct HybridConvolutionHermitian2 HybridConvolutionHermitian2;
HybridConvolutionHermitian2 *fftwpp_create_hconv2d(size_t mx, size_t my);
HybridConvolutionHermitian2 *fftwpp_create_hconv2d_dot(size_t mx,
size_t my,
size_t M);
HybridConvolutionHermitian2 *fftwpp_create_hconv2d_work(size_t mx,
size_t my,
double __complex__ *u1,
double __complex__ *v1,
double __complex__ *w1,
double __complex__ *u2,
double __complex__ *v2);
HybridConvolutionHermitian2 *fftwpp_create_hconv2d_work_dot(size_t mx,
size_t my,
double __complex__ *u1,
double __complex__ *v1,
double __complex__ *w1,
double __complex__ *u2,
double __complex__ *v2,
size_t M);
void fftwpp_hconv2d_convolve(HybridConvolutionHermitian2 *conv,
double __complex__ *a, double __complex__ *b);
void fftwpp_hconv2d_convolve_dot(HybridConvolutionHermitian2 *conv,
double __complex__ **a,
double __complex__ **b);
void fftwpp_hconv2d_convolve_dotf(HybridConvolutionHermitian2 *conv,
double __complex__ *a,
double __complex__ *b);
void fftwpp_hconv2d_delete(HybridConvolutionHermitian2 *conv);
// 3d complex non-centered convolution
typedef struct HybridConvolution3 HybridConvolution3;
HybridConvolution3 *fftwpp_create_conv3d(size_t mx, size_t my,
size_t mz);
HybridConvolution3 *fftwpp_create_conv3d_work(size_t mx,
size_t my,
size_t mz,
double __complex__ *u1,
double __complex__ *v1,
double __complex__ *u2,
double __complex__ *v2,
double __complex__ *u3,
double __complex__ *v3);
HybridConvolution3 *fftwpp_create_conv3d_dot(size_t mx,
size_t my,
size_t mz,
size_t M);
void fftwpp_conv3d_convolve(HybridConvolution3 *conv,
double __complex__ *a, double __complex__ *b);
void fftwpp_conv3d_convolve_dot(HybridConvolution3 *conv,
double __complex__ **a, double __complex__ **b);
void fftwpp_conv3d_convolve_dotf(HybridConvolution3 *conv,
double __complex__ *a, double __complex__ *b);
void fftwpp_conv3d_delete(HybridConvolution3 *conv);
// 3d Hermitian-symmetric centered convolution
typedef struct HybridConvolutionHermitian3 HybridConvolutionHermitian3;
HybridConvolutionHermitian3 *fftwpp_create_hconv3d(size_t mx, size_t my,
size_t mz);
HybridConvolutionHermitian3 *fftwpp_create_hconv3d_dot(size_t mx,
size_t my,
size_t mz,
size_t M);
HybridConvolutionHermitian3 *fftwpp_create_hconv3d_work(size_t mx,
size_t my,
size_t mz,
double __complex__ *u1,
double __complex__ *v1,
double __complex__ *w1,
double __complex__ *u2,
double __complex__ *v2,
double __complex__ *u3,
double __complex__ *v3);
HybridConvolutionHermitian3 *fftwpp_create_hconv3d_work_dot(size_t mx,
size_t my,
size_t mz,
double __complex__ *u1,
double __complex__ *v1,
double __complex__ *w1,
double __complex__ *u2,
double __complex__ *v2,
double __complex__ *u3,
double __complex__ *v3,
size_t M);
void fftwpp_hconv3d_convolve(HybridConvolutionHermitian3 *conv,
double __complex__ *a, double __complex__ *b);
void fftwpp_hconv3d_convolve_dot(HybridConvolutionHermitian3 *conv,
double __complex__ **a,
double __complex__ **b);
void fftwpp_hconv3d_delete(HybridConvolutionHermitian3 *conv);
void fftwpp_HermitianSymmetrize(double __complex__ *f);
void fftwpp_HermitianSymmetrizeX(size_t Hx, size_t Hy,
size_t x0, double __complex__ *f);
void fftwpp_HermitianSymmetrizeXY(size_t Hx, size_t Hy,
size_t Hz,
size_t x0, size_t y0,
double __complex__ *f);
#ifdef __cplusplus
} }
#endif
#endif