2
* Copyright (c) 2003 Matteo Frigo
3
* Copyright (c) 2003 Massachusetts Institute of Technology
2
* Copyright (c) 2003, 2006 Matteo Frigo
3
* Copyright (c) 2003, 2006 Massachusetts Institute of Technology
5
5
* This program is free software; you can redistribute it and/or modify
6
6
* it under the terms of the GNU General Public License as published by
23
23
f77api.c, possibly multiple times in order to support multiple
24
24
compiler manglings (via redefinition of F77). */
26
void F77(execute, EXECUTE)(X(plan) * const p)
26
FFTW_VOIDFUNC F77(execute, EXECUTE)(X(plan) * const p)
27
27
WITH_ALIGNED_STACK({
28
28
plan *pln = (*p)->pln;
29
29
pln->adt->solve(pln, (*p)->prb);
32
void F77(destroy_plan, DESTROY_PLAN)(X(plan) *p)
32
FFTW_VOIDFUNC F77(destroy_plan, DESTROY_PLAN)(X(plan) *p)
34
34
X(destroy_plan)(*p);
37
void F77(cleanup, CLEANUP)(void)
37
FFTW_VOIDFUNC F77(cleanup, CLEANUP)(void)
42
void F77(forget_wisdom, FORGET_WISDOM)(void)
42
FFTW_VOIDFUNC F77(forget_wisdom, FORGET_WISDOM)(void)
44
44
X(forget_wisdom)();
47
void F77(export_wisdom, EXPORT_WISDOM)(void (*f77_write_char)(char *, void *),
47
FFTW_VOIDFUNC F77(export_wisdom, EXPORT_WISDOM)(void (*f77_write_char)(char *, void *),
50
50
write_char_data ad;
53
53
X(export_wisdom)(write_char, (void *) &ad);
56
void F77(import_wisdom, IMPORT_WISDOM)(int *isuccess,
56
FFTW_VOIDFUNC F77(import_wisdom, IMPORT_WISDOM)(int *isuccess,
57
57
void (*f77_read_char)(int *, void *),
63
63
*isuccess = X(import_wisdom)(read_char, (void *) &ed);
66
void F77(import_system_wisdom, IMPORT_SYSTEM_WISDOM)(int *isuccess)
66
FFTW_VOIDFUNC F77(import_system_wisdom, IMPORT_SYSTEM_WISDOM)(int *isuccess)
68
68
*isuccess = X(import_system_wisdom)();
71
void F77(print_plan, PRINT_PLAN)(X(plan) * const p)
71
FFTW_VOIDFUNC F77(print_plan, PRINT_PLAN)(X(plan) * const p)
76
void F77(flops,FLOPS)(X(plan) *p, double *add, double *mul, double *fma)
77
FFTW_VOIDFUNC F77(flops,FLOPS)(X(plan) *p, double *add, double *mul, double *fma)
78
79
X(flops)(*p, add, mul, fma);
81
82
/******************************** DFT ***********************************/
83
void F77(plan_dft, PLAN_DFT)(X(plan) *p, int *rank, const int *n,
84
FFTW_VOIDFUNC F77(plan_dft, PLAN_DFT)(X(plan) *p, int *rank, const int *n,
84
85
C *in, C *out, int *sign, int *flags)
86
87
int *nrev = reverse_n(*rank, n);
91
void F77(plan_dft_1d, PLAN_DFT_1D)(X(plan) *p, int *n, C *in, C *out,
92
FFTW_VOIDFUNC F77(plan_dft_1d, PLAN_DFT_1D)(X(plan) *p, int *n, C *in, C *out,
92
93
int *sign, int *flags)
94
95
*p = X(plan_dft_1d)(*n, in, out, *sign, *flags);
97
void F77(plan_dft_2d, PLAN_DFT_2D)(X(plan) *p, int *nx, int *ny,
98
FFTW_VOIDFUNC F77(plan_dft_2d, PLAN_DFT_2D)(X(plan) *p, int *nx, int *ny,
98
99
C *in, C *out, int *sign, int *flags)
100
101
*p = X(plan_dft_2d)(*ny, *nx, in, out, *sign, *flags);
103
void F77(plan_dft_3d, PLAN_DFT_3D)(X(plan) *p, int *nx, int *ny, int *nz,
104
FFTW_VOIDFUNC F77(plan_dft_3d, PLAN_DFT_3D)(X(plan) *p, int *nx, int *ny, int *nz,
105
106
int *sign, int *flags)
107
108
*p = X(plan_dft_3d)(*nz, *ny, *nx, in, out, *sign, *flags);
110
void F77(plan_many_dft, PLAN_MANY_DFT)(X(plan) *p, int *rank, const int *n,
111
FFTW_VOIDFUNC F77(plan_many_dft, PLAN_MANY_DFT)(X(plan) *p, int *rank, const int *n,
112
113
C *in, const int *inembed,
113
114
int *istride, int *idist,
130
void F77(plan_guru_dft, PLAN_GURU_DFT)(X(plan) *p, int *rank, const int *n,
131
FFTW_VOIDFUNC F77(plan_guru_dft, PLAN_GURU_DFT)(X(plan) *p, int *rank, const int *n,
131
132
const int *is, const int *os,
132
133
int *howmany_rank, const int *h_n,
133
134
const int *h_is, const int *h_os,
144
void F77(plan_guru_split_dft, PLAN_GURU_SPLIT_DFT)(X(plan) *p, int *rank, const int *n,
145
FFTW_VOIDFUNC F77(plan_guru_split_dft, PLAN_GURU_SPLIT_DFT)(X(plan) *p, int *rank, const int *n,
145
146
const int *is, const int *os,
146
147
int *howmany_rank, const int *h_n,
147
148
const int *h_is, const int *h_os,
158
void F77(execute_dft, EXECUTE_DFT)(X(plan) * const p, C *in, C *out)
159
FFTW_VOIDFUNC F77(execute_dft, EXECUTE_DFT)(X(plan) * const p, C *in, C *out)
159
160
WITH_ALIGNED_STACK({
160
161
plan_dft *pln = (plan_dft *) (*p)->pln;
161
162
if ((*p)->sign == FFT_SIGN)
164
165
pln->apply((plan *) pln, in[0]+1, in[0], out[0]+1, out[0]);
167
void F77(execute_split_dft, EXECUTE_SPLIT_DFT)(X(plan) * const p,
168
FFTW_VOIDFUNC F77(execute_split_dft, EXECUTE_SPLIT_DFT)(X(plan) * const p,
168
169
R *ri, R *ii, R *ro, R *io)
169
170
WITH_ALIGNED_STACK({
170
171
plan_dft *pln = (plan_dft *) (*p)->pln;
174
175
/****************************** DFT r2c *********************************/
176
void F77(plan_dft_r2c, PLAN_DFT_R2C)(X(plan) *p, int *rank, const int *n,
177
FFTW_VOIDFUNC F77(plan_dft_r2c, PLAN_DFT_R2C)(X(plan) *p, int *rank, const int *n,
177
178
R *in, C *out, int *flags)
179
180
int *nrev = reverse_n(*rank, n);
184
void F77(plan_dft_r2c_1d, PLAN_DFT_R2C_1D)(X(plan) *p, int *n, R *in, C *out,
185
FFTW_VOIDFUNC F77(plan_dft_r2c_1d, PLAN_DFT_R2C_1D)(X(plan) *p, int *n, R *in, C *out,
187
188
*p = X(plan_dft_r2c_1d)(*n, in, out, *flags);
190
void F77(plan_dft_r2c_2d, PLAN_DFT_R2C_2D)(X(plan) *p, int *nx, int *ny,
191
FFTW_VOIDFUNC F77(plan_dft_r2c_2d, PLAN_DFT_R2C_2D)(X(plan) *p, int *nx, int *ny,
191
192
R *in, C *out, int *flags)
193
194
*p = X(plan_dft_r2c_2d)(*ny, *nx, in, out, *flags);
196
void F77(plan_dft_r2c_3d, PLAN_DFT_R2C_3D)(X(plan) *p,
197
FFTW_VOIDFUNC F77(plan_dft_r2c_3d, PLAN_DFT_R2C_3D)(X(plan) *p,
197
198
int *nx, int *ny, int *nz,
201
202
*p = X(plan_dft_r2c_3d)(*nz, *ny, *nx, in, out, *flags);
204
void F77(plan_many_dft_r2c, PLAN_MANY_DFT_R2C)(
205
FFTW_VOIDFUNC F77(plan_many_dft_r2c, PLAN_MANY_DFT_R2C)(
205
206
X(plan) *p, int *rank, const int *n,
207
208
R *in, const int *inembed, int *istride, int *idist,
223
void F77(plan_guru_dft_r2c, PLAN_GURU_DFT_R2C)(
224
FFTW_VOIDFUNC F77(plan_guru_dft_r2c, PLAN_GURU_DFT_R2C)(
224
225
X(plan) *p, int *rank, const int *n,
225
226
const int *is, const int *os,
226
227
int *howmany_rank, const int *h_n,
238
void F77(plan_guru_split_dft_r2c, PLAN_GURU_SPLIT_DFT_R2C)(
239
FFTW_VOIDFUNC F77(plan_guru_split_dft_r2c, PLAN_GURU_SPLIT_DFT_R2C)(
239
240
X(plan) *p, int *rank, const int *n,
240
241
const int *is, const int *os,
241
242
int *howmany_rank, const int *h_n,
253
void F77(execute_dft_r2c, EXECUTE_DFT_R2C)(X(plan) * const p, R *in, C *out)
254
FFTW_VOIDFUNC F77(execute_dft_r2c, EXECUTE_DFT_R2C)(X(plan) * const p, R *in, C *out)
254
255
WITH_ALIGNED_STACK({
255
256
plan_rdft2 *pln = (plan_rdft2 *) (*p)->pln;
256
257
pln->apply((plan *) pln, in, out[0], out[0]+1);
259
void F77(execute_split_dft_r2c, EXECUTE_SPLIT_DFT_R2C)(X(plan) * const p,
260
FFTW_VOIDFUNC F77(execute_split_dft_r2c, EXECUTE_SPLIT_DFT_R2C)(X(plan) * const p,
260
261
R *in, R *ro, R *io)
261
262
WITH_ALIGNED_STACK({
262
263
plan_rdft2 *pln = (plan_rdft2 *) (*p)->pln;
266
267
/****************************** DFT c2r *********************************/
268
void F77(plan_dft_c2r, PLAN_DFT_C2R)(X(plan) *p, int *rank, const int *n,
269
FFTW_VOIDFUNC F77(plan_dft_c2r, PLAN_DFT_C2R)(X(plan) *p, int *rank, const int *n,
269
270
C *in, R *out, int *flags)
271
272
int *nrev = reverse_n(*rank, n);
276
void F77(plan_dft_c2r_1d, PLAN_DFT_C2R_1D)(X(plan) *p, int *n, C *in, R *out,
277
FFTW_VOIDFUNC F77(plan_dft_c2r_1d, PLAN_DFT_C2R_1D)(X(plan) *p, int *n, C *in, R *out,
279
280
*p = X(plan_dft_c2r_1d)(*n, in, out, *flags);
282
void F77(plan_dft_c2r_2d, PLAN_DFT_C2R_2D)(X(plan) *p, int *nx, int *ny,
283
FFTW_VOIDFUNC F77(plan_dft_c2r_2d, PLAN_DFT_C2R_2D)(X(plan) *p, int *nx, int *ny,
283
284
C *in, R *out, int *flags)
285
286
*p = X(plan_dft_c2r_2d)(*ny, *nx, in, out, *flags);
288
void F77(plan_dft_c2r_3d, PLAN_DFT_C2R_3D)(X(plan) *p,
289
FFTW_VOIDFUNC F77(plan_dft_c2r_3d, PLAN_DFT_C2R_3D)(X(plan) *p,
289
290
int *nx, int *ny, int *nz,
293
294
*p = X(plan_dft_c2r_3d)(*nz, *ny, *nx, in, out, *flags);
296
void F77(plan_many_dft_c2r, PLAN_MANY_DFT_C2R)(
297
FFTW_VOIDFUNC F77(plan_many_dft_c2r, PLAN_MANY_DFT_C2R)(
297
298
X(plan) *p, int *rank, const int *n,
299
300
C *in, const int *inembed, int *istride, int *idist,
315
void F77(plan_guru_dft_c2r, PLAN_GURU_DFT_C2R)(
316
FFTW_VOIDFUNC F77(plan_guru_dft_c2r, PLAN_GURU_DFT_C2R)(
316
317
X(plan) *p, int *rank, const int *n,
317
318
const int *is, const int *os,
318
319
int *howmany_rank, const int *h_n,
330
void F77(plan_guru_split_dft_c2r, PLAN_GURU_SPLIT_DFT_C2R)(
331
FFTW_VOIDFUNC F77(plan_guru_split_dft_c2r, PLAN_GURU_SPLIT_DFT_C2R)(
331
332
X(plan) *p, int *rank, const int *n,
332
333
const int *is, const int *os,
333
334
int *howmany_rank, const int *h_n,
345
void F77(execute_dft_c2r, EXECUTE_DFT_C2R)(X(plan) * const p, C *in, R *out)
346
FFTW_VOIDFUNC F77(execute_dft_c2r, EXECUTE_DFT_C2R)(X(plan) * const p, C *in, R *out)
346
347
WITH_ALIGNED_STACK({
347
348
plan_rdft2 *pln = (plan_rdft2 *) (*p)->pln;
348
349
pln->apply((plan *) pln, out, in[0], in[0]+1);
351
void F77(execute_split_dft_c2r, EXECUTE_SPLIT_DFT_C2R)(X(plan) * const p,
352
FFTW_VOIDFUNC F77(execute_split_dft_c2r, EXECUTE_SPLIT_DFT_C2R)(X(plan) * const p,
352
353
R *ri, R *ii, R *out)
353
354
WITH_ALIGNED_STACK({
354
355
plan_rdft2 *pln = (plan_rdft2 *) (*p)->pln;
358
359
/****************************** r2r *********************************/
360
void F77(plan_r2r, PLAN_R2R)(X(plan) *p, int *rank, const int *n,
361
FFTW_VOIDFUNC F77(plan_r2r, PLAN_R2R)(X(plan) *p, int *rank, const int *n,
362
363
int *kind, int *flags)
371
void F77(plan_r2r_1d, PLAN_R2R_1D)(X(plan) *p, int *n, R *in, R *out,
372
FFTW_VOIDFUNC F77(plan_r2r_1d, PLAN_R2R_1D)(X(plan) *p, int *n, R *in, R *out,
372
373
int *kind, int *flags)
374
375
*p = X(plan_r2r_1d)(*n, in, out, (X(r2r_kind)) *kind, *flags);
377
void F77(plan_r2r_2d, PLAN_R2R_2D)(X(plan) *p, int *nx, int *ny,
378
FFTW_VOIDFUNC F77(plan_r2r_2d, PLAN_R2R_2D)(X(plan) *p, int *nx, int *ny,
379
380
int *kindx, int *kindy, int *flags)
382
383
(X(r2r_kind)) *kindy, (X(r2r_kind)) *kindx, *flags);
385
void F77(plan_r2r_3d, PLAN_R2R_3D)(X(plan) *p,
386
FFTW_VOIDFUNC F77(plan_r2r_3d, PLAN_R2R_3D)(X(plan) *p,
386
387
int *nx, int *ny, int *nz,
388
389
int *kindx, int *kindy, int *kindz,
393
394
(X(r2r_kind)) *kindx, *flags);
396
void F77(plan_many_r2r, PLAN_MANY_R2R)(
397
FFTW_VOIDFUNC F77(plan_many_r2r, PLAN_MANY_R2R)(
397
398
X(plan) *p, int *rank, const int *n,
399
400
R *in, const int *inembed, int *istride, int *idist,
417
void F77(plan_guru_r2r, PLAN_GURU_R2R)(
418
FFTW_VOIDFUNC F77(plan_guru_r2r, PLAN_GURU_R2R)(
418
419
X(plan) *p, int *rank, const int *n,
419
420
const int *is, const int *os,
420
421
int *howmany_rank, const int *h_n,
434
void F77(execute_r2r, EXECUTE_R2R)(X(plan) * const p, R *in, R *out)
435
FFTW_VOIDFUNC F77(execute_r2r, EXECUTE_R2R)(X(plan) * const p, R *in, R *out)
435
436
WITH_ALIGNED_STACK({
436
437
plan_rdft *pln = (plan_rdft *) (*p)->pln;
437
438
pln->apply((plan *) pln, in, out);