74 #define FFTW3CXX_DEFINE_FFTW330_NEW_API(X, R, C) \
75 FFTW_EXTERN int X(export_wisdom_to_filename)(const char *filename); \
76 FFTW_EXTERN void X(export_wisdom_to_file)(FILE *output_file); \
77 FFTW_EXTERN int X(import_wisdom_from_filename)(const char *filename); \
78 FFTW_EXTERN int X(import_wisdom_from_file)(FILE *input_file); \
79 FFTW_EXTERN R *X(alloc_real)(size_t n); \
80 FFTW_EXTERN C *X(alloc_complex)(size_t n); \
81 FFTW_EXTERN double X(cost)(const X(plan) p);
83 #define FFTW3CXX_DEFINE_FFTW335_NEW_API(X, R, C) \
84 FFTW_EXTERN char *X(sprint_plan)(const X(plan) p); \
85 FFTW_EXTERN int X(alignment_of)(R *p); \
86 FFTW_EXTERN void X(make_planner_thread_safe)(void);
89 FFTW3CXX_DEFINE_FFTW330_NEW_API(FFTW_MANGLE_DOUBLE,
double, fftw_complex)
90 FFTW3CXX_DEFINE_FFTW330_NEW_API(FFTW_MANGLE_FLOAT,
float, fftwf_complex)
91 FFTW3CXX_DEFINE_FFTW330_NEW_API(FFTW_MANGLE_LONG_DOUBLE,
long double, fftwl_complex)
92 FFTW3CXX_DEFINE_FFTW335_NEW_API(FFTW_MANGLE_DOUBLE,
double, fftw_complex)
93 FFTW3CXX_DEFINE_FFTW335_NEW_API(FFTW_MANGLE_FLOAT,
float, fftwf_complex)
94 FFTW3CXX_DEFINE_FFTW335_NEW_API(FFTW_MANGLE_LONG_DOUBLE,
long double, fftwl_complex)
114 #define FFTW3CXX_DEFINE_API(X, R, C) \
118 typedef X(plan) plan; \
120 typedef X(complex) complex; \
121 typedef X(iodim) iodim; \
122 typedef X(iodim64) iodim64; \
123 typedef X(r2r_kind) r2r_kind; \
125 static void execute(const plan p) \
128 static plan plan_dft(int rank, const int *n, \
129 C *in, C *out, int sign, unsigned flags) \
130 { return X(plan_dft)(rank, n, in, out, sign, flags); } \
132 static plan plan_dft_1d(int n, C *in, C *out, \
133 int sign, unsigned flags) \
134 { return X(plan_dft_1d)(n, in, out, sign, flags); } \
135 static plan plan_dft_2d(int n0, int n1, \
136 C *in, C *out, int sign, unsigned flags) \
137 { return X(plan_dft_2d)(n0, n1, in, out, sign, flags); } \
138 static plan plan_dft_3d(int n0, int n1, int n2, \
139 C *in, C *out, int sign, unsigned flags) \
140 { return X(plan_dft_3d)(n0, n1, n2, in, out, sign, flags); } \
142 static plan plan_many_dft(int rank, const int *n, int howmany, \
143 C *in, const int *inembed, int istride, int idist, \
144 C *out, const int *onembed, int ostride, int odist, \
145 int sign, unsigned flags) \
146 { return X(plan_many_dft)(rank, n, howmany, \
147 in, inembed, istride, idist, \
148 out, onembed, ostride, odist, sign, flags); } \
150 static plan plan_guru_dft(int rank, const iodim *dims, \
151 int howmany_rank, const iodim *howmany_dims, \
152 C *in, C *out, int sign, unsigned flags) \
153 { return X(plan_guru_dft)(rank, dims, \
154 howmany_rank, howmany_dims, in, out, sign, flags); } \
155 static plan plan_guru_split_dft(int rank, const iodim *dims, \
156 int howmany_rank, const iodim *howmany_dims, \
157 R *ri, R *ii, R *ro, R *io, unsigned flags) \
158 { return X(plan_guru_split_dft)(rank, dims, \
159 howmany_rank, howmany_dims, ri, ii, ro, io, flags); } \
161 static plan plan_guru64_dft(int rank, const iodim64 *dims, \
162 int howmany_rank, const iodim64 *howmany_dims,\
163 C *in, C *out, int sign, unsigned flags) \
164 { return X(plan_guru64_dft)(rank, dims, \
165 howmany_rank, howmany_dims, in, out, sign, flags); } \
166 static plan plan_guru64_split_dft(int rank, const iodim64 *dims, \
167 int howmany_rank, const iodim64 *howmany_dims, \
168 R *ri, R *ii, R *ro, R *io, unsigned flags) \
169 { return X(plan_guru64_split_dft)(rank, dims, \
170 howmany_rank, howmany_dims, ri, ii, ro, io, flags); } \
172 static void execute_dft(const plan p, C *in, C *out) \
173 { X(execute_dft)(p, in, out); } \
174 static void execute_split_dft(const plan p, R *ri, R *ii, \
176 { X(execute_split_dft)(p, ri, ii, ro, io); } \
178 static plan plan_many_dft_r2c(int rank, const int *n, int howmany, \
179 R *in, const int *inembed, int istride, int idist, \
180 C *out, const int *onembed, int ostride, int odist, \
182 { return X(plan_many_dft_r2c)(rank, n, howmany, \
183 in, inembed, istride, idist, \
184 out, onembed, ostride, odist, flags); } \
186 static plan plan_dft_r2c(int rank, const int *n, \
187 R *in, C *out, unsigned flags) \
188 { return X(plan_dft_r2c)(rank, n, in, out, flags); } \
190 static plan plan_dft_r2c_1d(int n, R *in, C *out, \
192 { return X(plan_dft_r2c_1d)(n, in, out, flags); } \
193 static plan plan_dft_r2c_2d(int n0, int n1, \
194 R *in, C *out, unsigned flags) \
195 { return X(plan_dft_r2c_2d)(n0, n1, in, out, flags); } \
196 static plan plan_dft_r2c_3d(int n0, int n1, int n2, \
197 R *in, C *out, unsigned flags) \
198 { return X(plan_dft_r2c_3d)(n0, n1, n2, in, out, flags); } \
200 static plan plan_many_dft_c2r(int rank, const int *n, int howmany, \
201 C *in, const int *inembed, int istride, int idist, \
202 R *out, const int *onembed, int ostride, int odist, \
204 { return X(plan_many_dft_c2r)(rank, n, howmany, \
205 in, inembed, istride, idist, \
206 out, onembed, ostride, odist, flags); } \
208 static plan plan_dft_c2r(int rank, const int *n, \
209 C *in, R *out, unsigned flags) \
210 { return X(plan_dft_c2r)(rank, n, in, out, flags); } \
212 static plan plan_dft_c2r_1d(int n, C *in, R *out, unsigned flags) \
213 { return X(plan_dft_c2r_1d)(n, in, out, flags); } \
214 static plan plan_dft_c2r_2d(int n0, int n1, \
215 C *in, R *out, unsigned flags) \
216 { return X(plan_dft_c2r_2d)(n0, n1, in, out, flags); } \
217 static plan plan_dft_c2r_3d(int n0, int n1, int n2, \
218 C *in, R *out, unsigned flags) \
219 { return X(plan_dft_c2r_3d)(n0, n1, n2, in, out, flags); } \
221 static plan plan_guru_dft_r2c(int rank, const iodim *dims, \
222 int howmany_rank, const iodim *howmany_dims, \
223 R *in, C *out, unsigned flags) \
224 { return X(plan_guru_dft_r2c)(rank, dims, \
225 howmany_rank, howmany_dims, in, out, flags); } \
226 static plan plan_guru_dft_c2r(int rank, const iodim *dims, \
227 int howmany_rank, const iodim *howmany_dims, \
228 C *in, R *out, unsigned flags) \
229 { return X(plan_guru_dft_c2r)(rank, dims, \
230 howmany_rank, howmany_dims, in, out, flags); } \
232 static plan plan_guru_split_dft_r2c( \
233 int rank, const iodim *dims, \
234 int howmany_rank, const iodim *howmany_dims, \
235 R *in, R *ro, R *io, unsigned flags) \
236 { return X(plan_guru_split_dft_r2c)(rank, dims, \
237 howmany_rank, howmany_dims, in, ro, io, flags); } \
238 static plan plan_guru_split_dft_c2r( \
239 int rank, const iodim *dims, \
240 int howmany_rank, const iodim *howmany_dims, \
241 R *ri, R *ii, R *out, unsigned flags) \
242 { return X(plan_guru_split_dft_c2r)(rank, dims, \
243 howmany_rank, howmany_dims, ri, ii, out, flags); } \
245 static plan plan_guru64_dft_r2c(int rank, const iodim64 *dims, \
246 int howmany_rank, const iodim64 *howmany_dims, \
247 R *in, C *out, unsigned flags) \
248 { return X(plan_guru64_dft_r2c)(rank, dims, \
249 howmany_rank, howmany_dims, in, out, flags); } \
250 static plan plan_guru64_dft_c2r(int rank, const iodim64 *dims, \
251 int howmany_rank, const iodim64 *howmany_dims, \
252 C *in, R *out, unsigned flags) \
253 { return X(plan_guru64_dft_c2r)(rank, dims, \
254 howmany_rank, howmany_dims, in, out, flags); } \
256 static plan plan_guru64_split_dft_r2c( \
257 int rank, const iodim64 *dims, \
258 int howmany_rank, const iodim64 *howmany_dims, \
259 R *in, R *ro, R *io, unsigned flags) \
260 { return X(plan_guru64_split_dft_r2c)(rank, dims, \
261 howmany_rank, howmany_dims, in, ro, io, flags); } \
262 static plan plan_guru64_split_dft_c2r( \
263 int rank, const iodim64 *dims, \
264 int howmany_rank, const iodim64 *howmany_dims, \
265 R *ri, R *ii, R *out, unsigned flags) \
266 { return X(plan_guru64_split_dft_c2r)(rank, dims, \
267 howmany_rank, howmany_dims, ri, ii, out, flags); } \
269 static void execute_dft_r2c(const plan p, R *in, C *out) \
270 { X(execute_dft_r2c)(p, in, out); } \
271 static void execute_dft_c2r(const plan p, C *in, R *out) \
272 { X(execute_dft_c2r)(p, in, out); } \
274 static void execute_split_dft_r2c(const plan p, \
275 R *in, R *ro, R *io) \
276 { X(execute_split_dft_r2c)(p, in, ro, io); } \
277 static void execute_split_dft_c2r(const plan p, \
278 R *ri, R *ii, R *out) \
279 { X(execute_split_dft_c2r)(p, ri, ii, out); } \
281 static plan plan_many_r2r(int rank, const int *n, int howmany, \
282 R *in, const int *inembed, int istride, int idist, \
283 R *out, const int *onembed, int ostride, int odist, \
284 const r2r_kind *kind, unsigned flags) \
285 { return X(plan_many_r2r)(rank, n, howmany, \
286 in, inembed, istride, idist, out, onembed, ostride, odist, \
289 static plan plan_r2r(int rank, const int *n, R *in, R *out, \
290 const r2r_kind *kind, unsigned flags) \
291 { return X(plan_r2r)(rank, n, in, out, kind, flags); } \
293 static plan plan_r2r_1d(int n, R *in, R *out, \
294 r2r_kind kind, unsigned flags) \
295 { return X(plan_r2r_1d)(n, in, out, kind, flags); } \
296 static plan plan_r2r_2d(int n0, int n1, R *in, R *out, \
297 r2r_kind kind0, r2r_kind kind1, unsigned flags) \
298 { return X(plan_r2r_2d)(n0, n1, in, out, kind0, kind1, flags); } \
299 static plan plan_r2r_3d(int n0, int n1, int n2, \
301 r2r_kind kind0, r2r_kind kind1, r2r_kind kind2, unsigned flags) \
302 { return X(plan_r2r_3d)(n0, n1, n2, in, out, \
303 kind0, kind1, kind2, flags); } \
305 static plan plan_guru_r2r(int rank, const iodim *dims, \
306 int howmany_rank, const iodim *howmany_dims, \
307 R *in, R *out, const r2r_kind *kind, unsigned flags) \
308 { return X(plan_guru_r2r)(rank, dims, \
309 howmany_rank, howmany_dims, in, out, kind, flags); } \
311 static plan plan_guru64_r2r(int rank, const iodim64 *dims, \
312 int howmany_rank, const iodim64 *howmany_dims, \
313 R *in, R *out, const r2r_kind *kind, unsigned flags) \
314 { return X(plan_guru64_r2r)(rank, dims, \
315 howmany_rank, howmany_dims, in, out, kind, flags); } \
317 static void execute_r2r(const plan p, R *in, R *out) \
318 { X(execute_r2r)(p, in, out); } \
320 static void destroy_plan(plan p) { X(destroy_plan)(p); } \
321 static void forget_wisdom(void) { X(forget_wisdom)(); } \
322 static void cleanup(void) { X(cleanup)(); } \
324 static void set_timelimit(double t) \
325 { X(set_timelimit)(t); } \
327 static void plan_with_nthreads(int nthreads) \
328 { X(plan_with_nthreads)(nthreads); } \
329 static int init_threads(void) \
330 { return X(init_threads)(); } \
331 static void cleanup_threads(void) \
332 { X(cleanup_threads)(); } \
333 static void make_planner_thread_safe(void) \
334 { X(make_planner_thread_safe)(); } \
336 static int export_wisdom_to_filename(const char *filename) \
337 { return X(export_wisdom_to_filename)(filename); } \
338 static void export_wisdom_to_file(FILE *output_file) \
339 { X(export_wisdom_to_file)(output_file); } \
340 static char *export_wisdom_to_string(void) \
341 { return X(export_wisdom_to_string)(); } \
342 static void export_wisdom(void (*write_char)(char, void*), void *data) \
343 { X(export_wisdom)(write_char, data); } \
345 static int import_system_wisdom(void) \
346 { return X(import_system_wisdom)(); } \
347 static int import_wisdom_from_filename(const char *filename) \
348 { return X(import_wisdom_from_filename)(filename); } \
349 static int import_wisdom_from_file(FILE *input_file) \
350 { return X(import_wisdom_from_file)(input_file); } \
351 static int import_wisdom_from_string(const char *input_string) \
352 { return X(import_wisdom_from_string)(input_string); } \
353 static int import_wisdom(int (*read_char)(void*), void *data) \
354 { return X(import_wisdom)(read_char, data); } \
356 static void fprint_plan(const plan p, FILE *output_file) \
357 { X(fprint_plan)(p, output_file); } \
358 static void print_plan(const plan p) \
359 { X(print_plan)(p); } \
360 static char *sprint_plan(const plan p) \
361 { return X(sprint_plan)(p); } \
363 static void *malloc(size_t n) \
364 { return X(malloc)(n); } \
365 static R *alloc_real(size_t n) \
366 { return X(alloc_real)(n); } \
367 static C *alloc_complex(size_t n) \
368 { return X(alloc_complex)(n); } \
369 static void free(void *p) \
372 static void flops(const plan p, \
373 double *add, double *mul, double *fmas) \
374 { X(flops)(p, add, mul, fmas); } \
375 static double estimate_cost(const plan p) \
376 { return X(estimate_cost)(p); } \
377 static double cost(const plan p) \
378 { return X(cost)(p); } \
380 static int alignment_of(R *p) \
381 { return X(alignment_of)(p); } \
382 static const char *version(void) \
383 { return X(version); } \
384 static const char *cc(void) \
386 static const char *codelet_optim(void) \
387 { return X(codelet_optim); } \
395 FFTW3CXX_DEFINE_API(FFTW_MANGLE_DOUBLE,
double, fftw_complex)
396 FFTW3CXX_DEFINE_API(FFTW_MANGLE_FLOAT,
float, fftwf_complex)
397 FFTW3CXX_DEFINE_API(FFTW_MANGLE_LONG_DOUBLE,
long double, fftwl_complex)
415 typedef std::complex<T> SC;
418 typedef SC std_complex;
423 plan(
void): paux(0) {}
425 plan(
const self_type &other): paux(other.paux) { inc(); }
426 ~plan(
void) { dec(); }
427 void swap(self_type &other)
428 { aux *tmp = other.paux; other.paux = paux; paux = tmp; }
429 self_type& operator=(self_type other)
430 { swap(other);
return *
this; }
431 void clear(
void) { self_type t; *
this = t; }
432 bool empty(
void)
const {
return paux==0; }
439 void execute(
void)
const
442 static self_type plan_dft(
int rank,
const int *n,
443 C *in, C *out,
int sign,
unsigned flags)
445 static self_type plan_dft(
int rank,
const int *n,
446 SC *in, SC *out,
int sign,
unsigned flags)
449 static self_type plan_dft_1d(
int n,
450 C *in, C *out,
int sign,
unsigned flags)
452 static self_type plan_dft_1d(
int n,
453 SC *in, SC *out,
int sign,
unsigned flags)
455 static self_type plan_dft_2d(
int n0,
int n1,
456 C *in, C *out,
int sign,
unsigned flags)
458 static self_type plan_dft_2d(
int n0,
int n1,
459 SC *in, SC *out,
int sign,
unsigned flags)
461 static self_type plan_dft_3d(
int n0,
int n1,
int n2,
462 C *in, C *out,
int sign,
unsigned flags)
464 static self_type plan_dft_3d(
int n0,
int n1,
int n2,
465 SC *in, SC *out,
int sign,
unsigned flags)
468 static self_type plan_many_dft(
int rank,
const int *n,
int howmany,
469 C *in,
const int *inembed,
int istride,
int idist,
470 C *out,
const int *onembed,
int ostride,
int odist,
471 int sign,
unsigned flags)
473 in, inembed, istride, idist,
474 out, onembed, ostride, odist, sign, flags); }
475 static self_type plan_many_dft(
int rank,
const int *n,
int howmany,
476 SC *in,
const int *inembed,
int istride,
int idist,
477 SC *out,
const int *onembed,
int ostride,
int odist,
478 int sign,
unsigned flags)
480 (C*)in, inembed, istride, idist,
481 (C*)out, onembed, ostride, odist, sign, flags); }
483 static self_type plan_guru_dft(
int rank,
const iodim *dims,
484 int howmany_rank,
const iodim *howmany_dims,
485 C *in, C *out,
int sign,
unsigned flags)
487 howmany_rank, howmany_dims, in, out, sign, flags); }
488 static self_type plan_guru_dft(
int rank,
const iodim *dims,
489 int howmany_rank,
const iodim *howmany_dims,
490 SC *in, SC *out,
int sign,
unsigned flags)
492 howmany_rank, howmany_dims, (C*)in, (C*)out, sign, flags); }
493 static self_type plan_guru_split_dft(
int rank,
const iodim *dims,
494 int howmany_rank,
const iodim *howmany_dims,
495 R *ri, R *ii, R *ro, R *io,
unsigned flags)
497 howmany_rank, howmany_dims, ri, ii, ro, io, flags); }
499 static self_type plan_guru64_dft(
int rank,
const iodim64 *dims,
500 int howmany_rank,
const iodim64 *howmany_dims,
501 C *in, C *out,
int sign,
unsigned flags)
503 howmany_rank, howmany_dims, in, out, sign, flags); }
504 static self_type plan_guru64_dft(
int rank,
const iodim64 *dims,
505 int howmany_rank,
const iodim64 *howmany_dims,
506 SC *in, SC *out,
int sign,
unsigned flags)
508 howmany_rank, howmany_dims, (C*)in, (C*)out, sign, flags); }
509 static self_type plan_guru64_split_dft(
int rank,
const iodim64 *dims,
510 int howmany_rank,
const iodim64 *howmany_dims,
511 R *ri, R *ii, R *ro, R *io,
unsigned flags)
513 howmany_rank, howmany_dims, ri, ii, ro, io, flags); }
515 void execute_dft(C *in, C *out)
const
517 void execute_dft(SC *in, SC *out)
const
519 void execute_split_dft(R *ri, R *ii, R *ro, R *io)
const
522 static self_type plan_many_dft_r2c(
int rank,
const int *n,
int howmany,
523 R *in,
const int *inembed,
int istride,
int idist,
524 C *out,
const int *onembed,
int ostride,
int odist,
527 in, inembed, istride, idist,
528 out, onembed, ostride, odist, flags); }
529 static self_type plan_many_dft_r2c(
int rank,
const int *n,
int howmany,
530 R *in,
const int *inembed,
int istride,
int idist,
531 SC *out,
const int *onembed,
int ostride,
int odist,
534 in, inembed, istride, idist,
535 (C*)out, onembed, ostride, odist, flags); }
537 static self_type plan_dft_r2c(
int rank,
const int *n,
538 R *in, C *out,
unsigned flags)
540 static self_type plan_dft_r2c(
int rank,
const int *n,
541 R *in, SC *out,
unsigned flags)
544 static self_type plan_dft_r2c_1d(
int n, R *in, C *out,
547 static self_type plan_dft_r2c_1d(
int n, R *in, SC *out,
550 static self_type plan_dft_r2c_2d(
int n0,
int n1,
551 R *in, C *out,
unsigned flags)
553 static self_type plan_dft_r2c_2d(
int n0,
int n1,
554 R *in, SC *out,
unsigned flags)
556 static self_type plan_dft_r2c_3d(
int n0,
int n1,
int n2,
557 R *in, C *out,
unsigned flags)
559 static self_type plan_dft_r2c_3d(
int n0,
int n1,
int n2,
560 R *in, SC *out,
unsigned flags)
563 static self_type plan_many_dft_c2r(
int rank,
const int *n,
int howmany,
564 C *in,
const int *inembed,
int istride,
int idist,
565 R *out,
const int *onembed,
int ostride,
int odist,
568 in, inembed, istride, idist,
569 out, onembed, ostride, odist, flags); }
570 static self_type plan_many_dft_c2r(
int rank,
const int *n,
int howmany,
571 SC *in,
const int *inembed,
int istride,
int idist,
572 R *out,
const int *onembed,
int ostride,
int odist,
575 (C*)in, inembed, istride, idist,
576 out, onembed, ostride, odist, flags); }
578 static self_type plan_dft_c2r(
int rank,
const int *n,
579 C *in, R *out,
unsigned flags)
581 static self_type plan_dft_c2r(
int rank,
const int *n,
582 SC *in, R *out,
unsigned flags)
585 static self_type plan_dft_c2r_1d(
int n, C *in, R *out,
unsigned flags)
587 static self_type plan_dft_c2r_1d(
int n, SC *in, R *out,
unsigned flags)
589 static self_type plan_dft_c2r_2d(
int n0,
int n1,
590 C *in, R *out,
unsigned flags)
592 static self_type plan_dft_c2r_2d(
int n0,
int n1,
593 SC *in, R *out,
unsigned flags)
595 static self_type plan_dft_c2r_3d(
int n0,
int n1,
int n2,
596 C *in, R *out,
unsigned flags)
598 static self_type plan_dft_c2r_3d(
int n0,
int n1,
int n2,
599 SC *in, R *out,
unsigned flags)
602 static self_type plan_guru_dft_r2c(
int rank,
const iodim *dims,
603 int howmany_rank,
const iodim *howmany_dims,
604 R *in, C *out,
unsigned flags)
606 howmany_rank, howmany_dims, in, out, flags); }
607 static self_type plan_guru_dft_r2c(
int rank,
const iodim *dims,
608 int howmany_rank,
const iodim *howmany_dims,
609 R *in, SC *out,
unsigned flags)
611 howmany_rank, howmany_dims, in, (C*)out, flags); }
612 static self_type plan_guru_dft_c2r(
int rank,
const iodim *dims,
613 int howmany_rank,
const iodim *howmany_dims,
614 C *in, R *out,
unsigned flags)
616 howmany_rank, howmany_dims, in, out, flags); }
617 static self_type plan_guru_dft_c2r(
int rank,
const iodim *dims,
618 int howmany_rank,
const iodim *howmany_dims,
619 SC *in, R *out,
unsigned flags)
621 howmany_rank, howmany_dims, (C*)in, out, flags); }
623 static self_type plan_guru_split_dft_r2c(
624 int rank,
const iodim *dims,
625 int howmany_rank,
const iodim *howmany_dims,
626 R *in, R *ro, R *io,
unsigned flags)
628 howmany_rank, howmany_dims, in, ro, io, flags); }
629 static self_type plan_guru_split_dft_c2r(
630 int rank,
const iodim *dims,
631 int howmany_rank,
const iodim *howmany_dims,
632 R *ri, R *ii, R *out,
unsigned flags)
634 howmany_rank, howmany_dims, ri, ii, out, flags); }
636 static self_type plan_guru64_dft_r2c(
int rank,
const iodim64 *dims,
637 int howmany_rank,
const iodim64 *howmany_dims,
638 R *in, C *out,
unsigned flags)
640 howmany_rank, howmany_dims, in, out, flags); }
641 static self_type plan_guru64_dft_r2c(
int rank,
const iodim64 *dims,
642 int howmany_rank,
const iodim64 *howmany_dims,
643 R *in, SC *out,
unsigned flags)
645 howmany_rank, howmany_dims, in, (C*)out, flags); }
646 static self_type plan_guru64_dft_c2r(
int rank,
const iodim64 *dims,
647 int howmany_rank,
const iodim64 *howmany_dims,
648 C *in, R *out,
unsigned flags)
650 howmany_rank, howmany_dims, in, out, flags); }
651 static self_type plan_guru64_dft_c2r(
int rank,
const iodim64 *dims,
652 int howmany_rank,
const iodim64 *howmany_dims,
653 SC *in, R *out,
unsigned flags)
655 howmany_rank, howmany_dims, (C*)in, out, flags); }
657 static self_type plan_guru64_split_dft_r2c(
658 int rank,
const iodim64 *dims,
659 int howmany_rank,
const iodim64 *howmany_dims,
660 R *in, R *ro, R *io,
unsigned flags)
662 howmany_rank, howmany_dims, in, ro, io, flags); }
663 static self_type plan_guru64_split_dft_c2r(
664 int rank,
const iodim64 *dims,
665 int howmany_rank,
const iodim64 *howmany_dims,
666 R *ri, R *ii, R *out,
unsigned flags)
668 howmany_rank, howmany_dims, ri, ii, out, flags); }
670 void execute_dft_r2c(R *in, C *out)
const
672 void execute_dft_r2c(R *in, SC *out)
const
674 void execute_dft_c2r(C *in, R *out)
const
676 void execute_dft_c2r(SC *in, R *out)
const
679 void execute_split_dft_r2c(R *in, R *ro, R *io)
const
681 void execute_split_dft_c2r(R *ri, R *ii, R *out)
const
684 static self_type plan_many_r2r(
int rank,
const int *n,
int howmany,
685 R *in,
const int *inembed,
int istride,
int idist,
686 R *out,
const int *onembed,
int ostride,
int odist,
687 const r2r_kind *kind,
unsigned flags)
689 in, inembed, istride, idist, out, onembed, ostride, odist,
692 static self_type plan_r2r(
int rank,
const int *n, R *in, R *out,
693 const r2r_kind *kind,
unsigned flags)
696 static self_type plan_r2r_1d(
int n, R *in, R *out,
697 r2r_kind kind,
unsigned flags)
699 static self_type plan_r2r_2d(
int n0,
int n1, R *in, R *out,
700 r2r_kind kind0, r2r_kind kind1,
unsigned flags)
702 static self_type plan_r2r_3d(
int n0,
int n1,
int n2,
704 r2r_kind kind0, r2r_kind kind1, r2r_kind kind2,
unsigned flags)
706 kind0, kind1, kind2, flags); }
708 static self_type plan_guru_r2r(
int rank,
const iodim *dims,
709 int howmany_rank,
const iodim *howmany_dims,
710 R *in, R *out,
const r2r_kind *kind,
unsigned flags)
712 howmany_rank, howmany_dims, in, out, kind, flags); }
714 static self_type plan_guru64_r2r(
int rank,
const iodim64 *dims,
715 int howmany_rank,
const iodim64 *howmany_dims,
716 R *in, R *out,
const r2r_kind *kind,
unsigned flags)
718 howmany_rank, howmany_dims, in, out, kind, flags); }
720 void execute_r2r(R *in, R *out)
const
726 void fprint(FILE *output_file)
const
728 void print(
void)
const
730 char *sprint(
void)
const
732 void flops(
double *add,
double *mul,
double *fmas)
const
734 double estimate_cost(
void)
const
736 double cost(
void)
const
745 void inc(
void) { ++refcnt; }
746 unsigned dec(
void) {
return --refcnt; }
747 friend class plan<T>;
750 void inc(
void) {
if (paux) paux->inc(); }
751 void dec(
void) {
if (paux && !paux->dec()) {
delete paux; paux = 0; } }
753 if (!paux)
throw std::runtime_error(
"plan is not initialized");
767 inline void forget_wisdom(
void)
770 inline void cleanup(
void)
771 { fftw<T>::cleanup(); }
774 inline void set_timelimit(
double t)
775 { fftw<T>::set_timelimit(t); }
778 inline void plan_with_nthreads(
int nthreads)
779 { fftw<T>::plan_with_nthreads(nthreads); }
781 inline int init_threads(
void)
782 {
return fftw<T>::init_threads(); }
784 inline void cleanup_threads(
void)
785 { fftw<T>::cleanup_threads(); }
787 inline void make_planner_thread_safe(
void)
788 { fftw<T>::make_planner_thread_safe(); }
791 inline int export_wisdom_to_filename(
const char *filename)
792 {
return fftw<T>::export_wisdom_to_filename(filename); }
794 inline void export_wisdom_to_file(FILE *output_file)
795 { fftw<T>::export_wisdom_to_file(output_file); }
797 inline char *export_wisdom_to_string(
void)
798 {
return fftw<T>::export_wisdom_to_string(); }
800 inline void export_wisdom(
void (*write_char)(
char,
void*),
void *data)
801 { fftw<T>::export_wisdom(write_char, data); }
804 inline int import_system_wisdom(
void)
805 {
return fftw<T>::import_system_wisdom(); }
807 inline int import_wisdom_from_filename(
const char *filename)
808 {
return fftw<T>::import_wisdom_from_filename(filename); }
810 inline int import_wisdom_from_file(FILE *input_file)
811 {
return fftw<T>::import_wisdom_from_file(input_file); }
813 inline int import_wisdom_from_string(
const char *input_string)
814 {
return fftw<T>::import_wisdom_from_string(input_string); }
816 inline int import_wisdom(
int (*read_char)(
void*),
void *data)
817 {
return fftw<T>::import_wisdom(read_char, data); }
820 inline void *malloc(
size_t n)
821 {
return fftw<T>::malloc(n); }
823 inline T *alloc_real(
size_t n)
824 {
return fftw<T>::alloc_real(n); }
826 inline typename fftw<T>::complex *alloc_complex(
size_t n)
827 {
return fftw<T>::alloc_complex(n); }
829 inline void free(
void *p)
830 { fftw<T>::free(p); }
833 inline int alignment_of(T *p)
834 {
return fftw<T>::alignment_of(p); }
836 inline const char *version(
void)
837 {
return fftw<T>::version; }
839 inline const char *cc(
void)
840 {
return fftw<T>::cc; }
842 inline const char *codelet_optim(
void)
843 {
return fftw<T>::codelet_optim; }
Definition: fftw3cxx.h:392
Definition: fftw3cxx.h:410