~ubuntu-branches/ubuntu/raring/fftw3/raring-proposed

« back to all changes in this revision

Viewing changes to api/f77funcs.h

  • Committer: Bazaar Package Importer
  • Author(s): Paul Brossier
  • Date: 2006-05-31 13:44:05 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060531134405-ol9hrbg6bh81sg0c
Tags: 3.1.1-1
* New upstream release (closes: #350327, #338487, #338501)
* Add --enable-portable-binary to use -mtune instead of -march
* Use --with-gcc-arch=G5 / pentium4 on powerpc / i386
* Updated Standards-Version

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
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
4
4
 *
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). */
25
25
 
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);
30
30
})
31
31
 
32
 
void F77(destroy_plan, DESTROY_PLAN)(X(plan) *p)
 
32
FFTW_VOIDFUNC F77(destroy_plan, DESTROY_PLAN)(X(plan) *p)
33
33
{
34
34
     X(destroy_plan)(*p);
35
35
}
36
36
 
37
 
void F77(cleanup, CLEANUP)(void)
 
37
FFTW_VOIDFUNC F77(cleanup, CLEANUP)(void)
38
38
{
39
39
     X(cleanup)();
40
40
}
41
41
 
42
 
void F77(forget_wisdom, FORGET_WISDOM)(void)
 
42
FFTW_VOIDFUNC F77(forget_wisdom, FORGET_WISDOM)(void)
43
43
{
44
44
     X(forget_wisdom)();
45
45
}
46
46
 
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 *),
48
48
                                       void *data)
49
49
{
50
50
     write_char_data ad;
53
53
     X(export_wisdom)(write_char, (void *) &ad);
54
54
}
55
55
 
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 *),
58
58
                                       void *data)
59
59
{
63
63
     *isuccess = X(import_wisdom)(read_char, (void *) &ed);
64
64
}
65
65
 
66
 
void F77(import_system_wisdom, IMPORT_SYSTEM_WISDOM)(int *isuccess)
 
66
FFTW_VOIDFUNC F77(import_system_wisdom, IMPORT_SYSTEM_WISDOM)(int *isuccess)
67
67
{
68
68
     *isuccess = X(import_system_wisdom)();
69
69
}
70
70
 
71
 
void F77(print_plan, PRINT_PLAN)(X(plan) * const p)
 
71
FFTW_VOIDFUNC F77(print_plan, PRINT_PLAN)(X(plan) * const p)
72
72
{
73
73
     X(print_plan)(*p);
 
74
     fflush(stdout);
74
75
}
75
76
 
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)
77
78
{
78
79
     X(flops)(*p, add, mul, fma);
79
80
}
80
81
 
81
82
/******************************** DFT ***********************************/
82
83
 
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)
85
86
{
86
87
     int *nrev = reverse_n(*rank, n);
88
89
     X(ifree0)(nrev);
89
90
}
90
91
 
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)
93
94
{
94
95
     *p = X(plan_dft_1d)(*n, in, out, *sign, *flags);
95
96
}
96
97
 
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)
99
100
{
100
101
     *p = X(plan_dft_2d)(*ny, *nx, in, out, *sign, *flags);
101
102
}
102
103
 
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,
104
105
                                   C *in, C *out,
105
106
                                   int *sign, int *flags)
106
107
{
107
108
     *p = X(plan_dft_3d)(*nz, *ny, *nx, in, out, *sign, *flags);
108
109
}
109
110
 
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,
111
112
                                       int *howmany,
112
113
                                       C *in, const int *inembed,
113
114
                                       int *istride, int *idist,
127
128
     X(ifree0)(nrev);
128
129
}
129
130
 
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,
141
142
     X(ifree0)(dims);
142
143
}
143
144
 
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,
155
156
     X(ifree0)(dims);
156
157
}
157
158
 
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]);
165
166
})
166
167
 
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;
173
174
 
174
175
/****************************** DFT r2c *********************************/
175
176
 
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)
178
179
{
179
180
     int *nrev = reverse_n(*rank, n);
181
182
     X(ifree0)(nrev);
182
183
}
183
184
 
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,
185
186
                                           int *flags)
186
187
{
187
188
     *p = X(plan_dft_r2c_1d)(*n, in, out, *flags);
188
189
}
189
190
 
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)
192
193
{
193
194
     *p = X(plan_dft_r2c_2d)(*ny, *nx, in, out, *flags);
194
195
}
195
196
 
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,
198
199
                                           R *in, C *out,
199
200
                                           int *flags)
201
202
     *p = X(plan_dft_r2c_3d)(*nz, *ny, *nx, in, out, *flags);
202
203
}
203
204
 
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,
206
207
     int *howmany,
207
208
     R *in, const int *inembed, int *istride, int *idist,
220
221
     X(ifree0)(nrev);
221
222
}
222
223
 
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,
235
236
     X(ifree0)(dims);
236
237
}
237
238
 
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,
250
251
     X(ifree0)(dims);
251
252
}
252
253
 
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);
257
258
})
258
259
 
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;
265
266
 
266
267
/****************************** DFT c2r *********************************/
267
268
 
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)
270
271
{
271
272
     int *nrev = reverse_n(*rank, n);
273
274
     X(ifree0)(nrev);
274
275
}
275
276
 
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,
277
278
                                           int *flags)
278
279
{
279
280
     *p = X(plan_dft_c2r_1d)(*n, in, out, *flags);
280
281
}
281
282
 
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)
284
285
{
285
286
     *p = X(plan_dft_c2r_2d)(*ny, *nx, in, out, *flags);
286
287
}
287
288
 
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,
290
291
                                           C *in, R *out,
291
292
                                           int *flags)
293
294
     *p = X(plan_dft_c2r_3d)(*nz, *ny, *nx, in, out, *flags);
294
295
}
295
296
 
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,
298
299
     int *howmany,
299
300
     C *in, const int *inembed, int *istride, int *idist,
312
313
     X(ifree0)(nrev);
313
314
}
314
315
 
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,
327
328
     X(ifree0)(dims);
328
329
}
329
330
 
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,
342
343
     X(ifree0)(dims);
343
344
}
344
345
 
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);
349
350
})
350
351
 
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;
357
358
 
358
359
/****************************** r2r *********************************/
359
360
 
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,
361
362
                             R *in, R *out,
362
363
                             int *kind, int *flags)
363
364
{
368
369
     X(ifree0)(nrev);
369
370
}
370
371
 
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)
373
374
{
374
375
     *p = X(plan_r2r_1d)(*n, in, out, (X(r2r_kind)) *kind, *flags);
375
376
}
376
377
 
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,
378
379
                                   R *in, R *out, 
379
380
                                   int *kindx, int *kindy, int *flags)
380
381
{
382
383
                         (X(r2r_kind)) *kindy, (X(r2r_kind)) *kindx, *flags);
383
384
}
384
385
 
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,
387
388
                                   R *in, R *out,
388
389
                                   int *kindx, int *kindy, int *kindz,
393
394
                         (X(r2r_kind)) *kindx, *flags);
394
395
}
395
396
 
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,
398
399
     int *howmany,
399
400
     R *in, const int *inembed, int *istride, int *idist,
414
415
     X(ifree0)(nrev);
415
416
}
416
417
 
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,
431
432
     X(ifree0)(dims);
432
433
}
433
434
 
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);