(git:e70887f)
Loading...
Searching...
No Matches
fft_api_F.c
Go to the documentation of this file.
1/*----------------------------------------------------------------------------*/
2/* CP2K: A general program to perform molecular dynamics simulations */
3/* Copyright 2000-2026 CP2K developers group <https://cp2k.org> */
4/* */
5/* SPDX-License-Identifier: BSD-3-Clause */
6/*----------------------------------------------------------------------------*/
7
8#include "fft_api_F.h"
9#include "fft_lib.h"
10#include "fft_timer.h"
11
12#include "../base/cp_assert.h"
13#include <stdio.h>
14#include <string.h>
15
16/*******************************************************************************
17 * \brief Fortran interface for fft_library_init.
18 *
19 * \param backend_F Fortran-side FFT backend selector.
20 * \param fftw_plan FFTW planning mode.
21 * \param use_guru_interface Whether the FFTW guru interface may be used.
22 * \param wisdom_file Path to the FFTW wisdom file.
23 * \author Frederick Stein
24 ******************************************************************************/
25int fft_library_init_F(const int backend_F, const int fftw_plan,
26 const bool use_guru_interface, const char *wisdom_file) {
27 fft_lib backend;
28 switch (backend_F) {
30 backend = FFT_LIB_DEFAULT;
31 break;
33 backend = FFT_LIB_FFTW;
34 break;
36 backend = FFT_LIB_GPU;
37 break;
38 default:
39 return 1;
40 }
41 fftw_plan_type plan_type;
42 switch (fftw_plan) {
44 plan_type = FFT_ESTIMATE;
45 break;
47 plan_type = FFT_MEASURE;
48 break;
50 plan_type = FFT_PATIENT;
51 break;
53 plan_type = FFT_EXHAUSTIVE;
54 break;
55 default:
56 return 1;
57 }
58 return fft_init_lib(backend, plan_type, use_guru_interface, wisdom_file);
59}
60
61/*******************************************************************************
62 * \brief Fortran interface for fft_library_finalize.
63 *
64 * \param wisdom_file Path to the FFTW wisdom file.
65 * \author Frederick Stein
66 ******************************************************************************/
67void fft_library_finalize_F(const char *wisdom_file) {
68 fft_finalize_lib(wisdom_file);
70}
71
72/*******************************************************************************
73 * \brief Fortran interface for fft_print_timing_report.
74 *
75 * \param threshold Minimum relative timing value to report.
76 * \param fortran_comm Fortran MPI communicator handle.
77 * \author Frederick Stein
78 ******************************************************************************/
79void fft_print_timing_report_F(const double threshold, const int fortran_comm) {
80 fft_print_timing_report(threshold, cp_mpi_comm_f2c(fortran_comm));
81}
82
83/*******************************************************************************
84 * \brief Fortran interface for fft_print_timing_report_unit.
85 *
86 * \param threshold Minimum relative timing value to report.
87 * \param print_func Callback used to write the timing report.
88 * \param output_unit Fortran output unit for the timing report.
89 * \param fortran_comm Fortran MPI communicator handle.
90 * \author Frederick Stein
91 ******************************************************************************/
92void fft_print_timing_report_unit_F(const double threshold,
94 const int output_unit,
95 const int fortran_comm) {
96 fft_print_timing_report_unit(threshold, print_func, output_unit,
97 cp_mpi_comm_f2c(fortran_comm));
98}
99
100/*******************************************************************************
101 * \brief Allocate buffer of type double.
102 * \param length Number of elements.
103 * \param buffer Buffer pointer.
104 * \author Frederick Stein
105 ******************************************************************************/
106void fft_allocate_double_F(const int length, double **buffer) {
107 fft_allocate_double(length, buffer);
108}
109
110/*******************************************************************************
111 * \brief Allocate buffer of type double complex.
112 * \param length Number of elements.
113 * \param buffer Buffer pointer.
114 * \author Frederick Stein
115 ******************************************************************************/
116void fft_allocate_complex_F(const int length, double complex **buffer) {
117 fft_allocate_complex(length, buffer);
118}
119
120/*******************************************************************************
121 * \brief Allocate buffer of type double.
122 * \param buffer Buffer pointer.
123 * \author Frederick Stein
124 ******************************************************************************/
125void fft_free_double_F(double *buffer) { fft_free_double(buffer); }
126
127/*******************************************************************************
128 * \brief Allocate buffer of type double complex.
129 * \param buffer Buffer pointer.
130 * \author Frederick Stein
131 ******************************************************************************/
132void fft_free_complex_F(double complex *buffer) { fft_free_complex(buffer); }
133
134/*******************************************************************************
135 * \brief Fortran interface for fft_backend_in_use.
136 *
137 * \author Frederick Stein
138 ******************************************************************************/
140 switch (fft_lib_backend_in_use()) {
141 case FFT_LIB_FFTW:
143 case FFT_LIB_GPU:
145 default:
147 }
148}
149
150/*******************************************************************************
151 * \brief Fortran interface for fft_has_guru_interface.
152 *
153 * \author Frederick Stein
154 ******************************************************************************/
156
157/*******************************************************************************
158 * \brief Fortran interface for fft_register_1d_local.
159 *
160 * \param dir FFT direction: true for forward, false for backward.
161 * \param fft_size Size of the transform in each dimension.
162 * \param number_of_ffts Number of independent transforms (batch size).
163 * \param transpose_in Whether the input has the transposed layout.
164 * \param transpose_out Whether the output has the transposed layout.
165 * \param leading_dimension_in Leading dimension of the input buffer.
166 * \param leading_dimension_out Leading dimension of the output buffer.
167 * \param grid_in Input grid buffer.
168 * \param grid_out Output grid buffer.
169 * \author Frederick Stein
170 ******************************************************************************/
171void fft_register_1d_local_F(const bool dir, const int fft_size,
172 const int number_of_ffts, const bool transpose_in,
173 const bool transpose_out,
174 const int leading_dimension_in,
175 const int leading_dimension_out,
176 double complex *grid_in,
177 double complex *grid_out) {
178 fft_register_1d_local(dir, fft_size, number_of_ffts, transpose_in,
179 transpose_out, leading_dimension_in,
180 leading_dimension_out, grid_in, grid_out);
181}
182
183/*******************************************************************************
184 * \brief Fortran interface for fft_register_2d_local.
185 *
186 * \param dir FFT direction: true for forward, false for backward.
187 * \param fft_size Size of the transform in each dimension.
188 * \param number_of_ffts Number of independent transforms (batch size).
189 * \param transpose_in Whether the input has the transposed layout.
190 * \param transpose_out Whether the output has the transposed layout.
191 * \param grid_in Input grid buffer.
192 * \param grid_out Output grid buffer.
193 * \author Frederick Stein
194 ******************************************************************************/
195void fft_register_2d_local_F(const bool dir, const int fft_size[2],
196 const int number_of_ffts, const bool transpose_in,
197 const bool transpose_out, double complex *grid_in,
198 double complex *grid_out) {
199 fft_register_2d_local(dir, (const int[]){fft_size[1], fft_size[0]},
200 number_of_ffts, transpose_in, transpose_out, grid_in,
201 grid_out);
202}
203
204/*******************************************************************************
205 * \brief Fortran interface for fft_register_3d_local.
206 *
207 * \param dir FFT direction: true for forward, false for backward.
208 * \param fft_size Size of the transform in each dimension.
209 * \param number_of_ffts Number of independent transforms (batch size).
210 * \param transpose_in Whether the input has the transposed layout.
211 * \param transpose_out Whether the output has the transposed layout.
212 * \param grid_in Input grid buffer.
213 * \param grid_out Output grid buffer.
214 * \author Frederick Stein
215 ******************************************************************************/
216void fft_register_3d_local_F(const bool dir, const int fft_size[3],
217 const int number_of_ffts, const bool transpose_in,
218 const bool transpose_out, double complex *grid_in,
219 double complex *grid_out) {
221 dir, (const int[]){fft_size[2], fft_size[1], fft_size[0]}, number_of_ffts,
222 transpose_in, transpose_out, grid_in, grid_out);
223}
224
225/*******************************************************************************
226 * \brief Fortran interface for fft_register_1d_local_inplace.
227 *
228 * \param dir FFT direction: true for forward, false for backward.
229 * \param fft_size Size of the transform in each dimension.
230 * \param number_of_ffts Number of independent transforms (batch size).
231 * \param transpose Whether the in-place buffer has the transposed layout.
232 * \param leading_dimension Leading dimension of the in-place buffer.
233 * \param grid In-place grid buffer.
234 * \author Frederick Stein
235 ******************************************************************************/
236void fft_register_1d_local_inplace_F(const bool dir, const int fft_size,
237 const int number_of_ffts,
238 const bool transpose,
239 const int leading_dimension,
240 double complex *grid) {
241 fft_register_1d_local(dir, fft_size, number_of_ffts, transpose, transpose,
242 leading_dimension, leading_dimension, grid, grid);
243}
244
245/*******************************************************************************
246 * \brief Fortran interface for fft_register_2d_local_inplace.
247 *
248 * \param dir FFT direction: true for forward, false for backward.
249 * \param fft_size Size of the transform in each dimension.
250 * \param number_of_ffts Number of independent transforms (batch size).
251 * \param transpose Whether the in-place buffer has the transposed layout.
252 * \param grid In-place grid buffer.
253 * \author Frederick Stein
254 ******************************************************************************/
255void fft_register_2d_local_inplace_F(const bool dir, const int fft_size[2],
256 const int number_of_ffts,
257 const bool transpose,
258 double complex *grid) {
259 fft_register_2d_local(dir, (const int[]){fft_size[1], fft_size[0]},
260 number_of_ffts, transpose, transpose, grid, grid);
261}
262
263/*******************************************************************************
264 * \brief Fortran interface for fft_register_3d_local_inplace.
265 *
266 * \param dir FFT direction: true for forward, false for backward.
267 * \param fft_size Size of the transform in each dimension.
268 * \param number_of_ffts Number of independent transforms (batch size).
269 * \param transpose Whether the in-place buffer has the transposed layout.
270 * \param grid In-place grid buffer.
271 * \author Frederick Stein
272 ******************************************************************************/
273void fft_register_3d_local_inplace_F(const bool dir, const int fft_size[3],
274 const int number_of_ffts,
275 const bool transpose,
276 double complex *grid) {
278 (const int[]){fft_size[2], fft_size[1], fft_size[0]},
279 number_of_ffts, transpose, transpose, grid, grid);
280}
281
282/*******************************************************************************
283 * \brief Fortran interface for fft_1d_local.
284 *
285 * \param dir FFT direction: true for forward, false for backward.
286 * \param fft_size Size of the transform in each dimension.
287 * \param number_of_ffts Number of independent transforms (batch size).
288 * \param transpose_in Whether the input has the transposed layout.
289 * \param transpose_out Whether the output has the transposed layout.
290 * \param leading_dimension_in Leading dimension of the input buffer.
291 * \param leading_dimension_out Leading dimension of the output buffer.
292 * \param grid_in Input grid buffer.
293 * \param grid_out Output grid buffer.
294 * \author Frederick Stein
295 ******************************************************************************/
296void fft_1d_local_F(const bool dir, const int fft_size,
297 const int number_of_ffts, const bool transpose_in,
298 const bool transpose_out, const int leading_dimension_in,
299 const int leading_dimension_out, double complex *grid_in,
300 double complex *grid_out) {
301 fft_1d_local(dir, fft_size, number_of_ffts, transpose_in, transpose_out,
302 leading_dimension_in, leading_dimension_out, grid_in, grid_out);
303}
304
305/*******************************************************************************
306 * \brief Fortran interface for fft_2d_local.
307 *
308 * \param dir FFT direction: true for forward, false for backward.
309 * \param fft_size Size of the transform in each dimension.
310 * \param number_of_ffts Number of independent transforms (batch size).
311 * \param transpose_in Whether the input has the transposed layout.
312 * \param transpose_out Whether the output has the transposed layout.
313 * \param grid_in Input grid buffer.
314 * \param grid_out Output grid buffer.
315 * \author Frederick Stein
316 ******************************************************************************/
317void fft_2d_local_F(const bool dir, const int fft_size[2],
318 const int number_of_ffts, const bool transpose_in,
319 const bool transpose_out, double complex *grid_in,
320 double complex *grid_out) {
321 fft_2d_local(dir, (const int[]){fft_size[1], fft_size[0]}, number_of_ffts,
322 transpose_in, transpose_out, grid_in, grid_out);
323}
324
325/*******************************************************************************
326 * \brief Fortran interface for fft_3d_local.
327 *
328 * \param dir FFT direction: true for forward, false for backward.
329 * \param fft_size Size of the transform in each dimension.
330 * \param number_of_ffts Number of independent transforms (batch size).
331 * \param transpose_in Whether the input has the transposed layout.
332 * \param transpose_out Whether the output has the transposed layout.
333 * \param grid_in Input grid buffer.
334 * \param grid_out Output grid buffer.
335 * \author Frederick Stein
336 ******************************************************************************/
337void fft_3d_local_F(const bool dir, const int fft_size[3],
338 const int number_of_ffts, const bool transpose_in,
339 const bool transpose_out, double complex *grid_in,
340 double complex *grid_out) {
341 fft_3d_local(dir, (const int[]){fft_size[2], fft_size[1], fft_size[0]},
342 number_of_ffts, transpose_in, transpose_out, grid_in, grid_out);
343}
344
345/*******************************************************************************
346 * \brief Fortran interface for fft_1d_local_inplace.
347 *
348 * \param dir FFT direction: true for forward, false for backward.
349 * \param fft_size Size of the transform in each dimension.
350 * \param number_of_ffts Number of independent transforms (batch size).
351 * \param transpose Whether the in-place buffer has the transposed layout.
352 * \param leading_dimension Leading dimension of the in-place buffer.
353 * \param grid In-place grid buffer.
354 * \author Frederick Stein
355 ******************************************************************************/
356void fft_1d_local_inplace_F(const bool dir, const int fft_size,
357 const int number_of_ffts, const bool transpose,
358 const int leading_dimension, double complex *grid) {
359 fft_1d_local(dir, fft_size, number_of_ffts, transpose, transpose,
360 leading_dimension, leading_dimension, grid, grid);
361}
362
363/*******************************************************************************
364 * \brief Fortran interface for fft_2d_local_inplace.
365 *
366 * \param dir FFT direction: true for forward, false for backward.
367 * \param fft_size Size of the transform in each dimension.
368 * \param number_of_ffts Number of independent transforms (batch size).
369 * \param transpose Whether the in-place buffer has the transposed layout.
370 * \param grid In-place grid buffer.
371 * \author Frederick Stein
372 ******************************************************************************/
373void fft_2d_local_inplace_F(const bool dir, const int fft_size[2],
374 const int number_of_ffts, const bool transpose,
375 double complex *grid) {
376 fft_2d_local(dir, (const int[]){fft_size[1], fft_size[0]}, number_of_ffts,
377 transpose, transpose, grid, grid);
378}
379
380/*******************************************************************************
381 * \brief Fortran interface for fft_3d_local_inplace.
382 *
383 * \param dir FFT direction: true for forward, false for backward.
384 * \param fft_size Size of the transform in each dimension.
385 * \param number_of_ffts Number of independent transforms (batch size).
386 * \param transpose Whether the in-place buffer has the transposed layout.
387 * \param grid In-place grid buffer.
388 * \author Frederick Stein
389 ******************************************************************************/
390void fft_3d_local_inplace_F(const bool dir, const int fft_size[3],
391 const int number_of_ffts, const bool transpose,
392 double complex *grid) {
393 fft_3d_local(dir, (const int[]){fft_size[2], fft_size[1], fft_size[0]},
394 number_of_ffts, transpose, transpose, grid, grid);
395}
396
397/*******************************************************************************
398 * \brief Fortran interface for fft_register_1d_r2c_local.
399 *
400 * \param fft_size Size of the transform in each dimension.
401 * \param number_of_ffts Number of independent transforms (batch size).
402 * \param transpose_in Whether the input has the transposed layout.
403 * \param transpose_out Whether the output has the transposed layout.
404 * \param leading_dimension_in Leading dimension of the input buffer.
405 * \param leading_dimension_out Leading dimension of the output buffer.
406 * \param grid_in Input grid buffer.
407 * \param grid_out Output grid buffer.
408 * \author Frederick Stein
409 ******************************************************************************/
410void fft_register_1d_r2c_local_F(const int fft_size, const int number_of_ffts,
411 const bool transpose_in,
412 const bool transpose_out,
413 const int leading_dimension_in,
414 const int leading_dimension_out,
415 double *grid_in, double complex *grid_out) {
416 fft_register_1d_r2c_local(fft_size, number_of_ffts, transpose_in,
417 transpose_out, leading_dimension_in,
418 leading_dimension_out, grid_in, grid_out);
419}
420
421/*******************************************************************************
422 * \brief Fortran interface for fft_register_1d_c2r_local.
423 *
424 * \param fft_size Size of the transform in each dimension.
425 * \param number_of_ffts Number of independent transforms (batch size).
426 * \param transpose_in Whether the input has the transposed layout.
427 * \param transpose_out Whether the output has the transposed layout.
428 * \param leading_dimension_in Leading dimension of the input buffer.
429 * \param leading_dimension_out Leading dimension of the output buffer.
430 * \param grid_in Input grid buffer.
431 * \param grid_out Output grid buffer.
432 * \author Frederick Stein
433 ******************************************************************************/
434void fft_register_1d_c2r_local_F(const int fft_size, const int number_of_ffts,
435 const bool transpose_in,
436 const bool transpose_out,
437 const int leading_dimension_in,
438 const int leading_dimension_out,
439 double complex *grid_in, double *grid_out) {
440 fft_register_1d_c2r_local(fft_size, number_of_ffts, transpose_in,
441 transpose_out, leading_dimension_in,
442 leading_dimension_out, grid_in, grid_out);
443}
444
445/*******************************************************************************
446 * \brief Fortran interface for fft_register_2d_r2c_local.
447 *
448 * \param fft_size Size of the transform in each dimension.
449 * \param number_of_ffts Number of independent transforms (batch size).
450 * \param transpose_in Whether the input has the transposed layout.
451 * \param transpose_out Whether the output has the transposed layout.
452 * \param grid_in Input grid buffer.
453 * \param grid_out Output grid buffer.
454 * \author Frederick Stein
455 ******************************************************************************/
456void fft_register_2d_r2c_local_F(const int fft_size[2],
457 const int number_of_ffts,
458 const bool transpose_in,
459 const bool transpose_out, double *grid_in,
460 double complex *grid_out) {
461 fft_register_2d_r2c_local((const int[]){fft_size[1], fft_size[0]},
462 number_of_ffts, transpose_in, transpose_out,
463 grid_in, grid_out);
464}
465
466/*******************************************************************************
467 * \brief Fortran interface for fft_register_2d_c2r_local.
468 *
469 * \param fft_size Size of the transform in each dimension.
470 * \param number_of_ffts Number of independent transforms (batch size).
471 * \param transpose_in Whether the input has the transposed layout.
472 * \param transpose_out Whether the output has the transposed layout.
473 * \param grid_in Input grid buffer.
474 * \param grid_out Output grid buffer.
475 * \author Frederick Stein
476 ******************************************************************************/
477void fft_register_2d_c2r_local_F(const int fft_size[2],
478 const int number_of_ffts,
479 const bool transpose_in,
480 const bool transpose_out,
481 double complex *grid_in, double *grid_out) {
482 fft_register_2d_c2r_local((const int[]){fft_size[1], fft_size[0]},
483 number_of_ffts, transpose_in, transpose_out,
484 grid_in, grid_out);
485}
486
487/*******************************************************************************
488 * \brief Fortran interface for fft_register_3d_r2c_local.
489 *
490 * \param fft_size Size of the transform in each dimension.
491 * \param number_of_ffts Number of independent transforms (batch size).
492 * \param transpose_in Whether the input has the transposed layout.
493 * \param transpose_out Whether the output has the transposed layout.
494 * \param grid_in Input grid buffer.
495 * \param grid_out Output grid buffer.
496 * \author Frederick Stein
497 ******************************************************************************/
498void fft_register_3d_r2c_local_F(const int fft_size[3],
499 const int number_of_ffts,
500 const bool transpose_in,
501 const bool transpose_out, double *grid_in,
502 double complex *grid_out) {
504 (const int[]){fft_size[2], fft_size[1], fft_size[0]}, number_of_ffts,
505 transpose_in, transpose_out, grid_in, grid_out);
506}
507
508/*******************************************************************************
509 * \brief Fortran interface for fft_register_3d_c2r_local.
510 *
511 * \param fft_size Size of the transform in each dimension.
512 * \param number_of_ffts Number of independent transforms (batch size).
513 * \param transpose_in Whether the input has the transposed layout.
514 * \param transpose_out Whether the output has the transposed layout.
515 * \param grid_in Input grid buffer.
516 * \param grid_out Output grid buffer.
517 * \author Frederick Stein
518 ******************************************************************************/
519void fft_register_3d_c2r_local_F(const int fft_size[3],
520 const int number_of_ffts,
521 const bool transpose_in,
522 const bool transpose_out,
523 double complex *grid_in, double *grid_out) {
525 (const int[]){fft_size[2], fft_size[1], fft_size[0]}, number_of_ffts,
526 transpose_in, transpose_out, grid_in, grid_out);
527}
528
529/*******************************************************************************
530 * \brief Fortran interface for fft_1d_r2c_local.
531 *
532 * \param fft_size Size of the transform in each dimension.
533 * \param number_of_ffts Number of independent transforms (batch size).
534 * \param transpose_in Whether the input has the transposed layout.
535 * \param transpose_out Whether the output has the transposed layout.
536 * \param leading_dimension_in Leading dimension of the input buffer.
537 * \param leading_dimension_out Leading dimension of the output buffer.
538 * \param grid_in Input grid buffer.
539 * \param grid_out Output grid buffer.
540 * \author Frederick Stein
541 ******************************************************************************/
542void fft_1d_r2c_local_F(const int fft_size, const int number_of_ffts,
543 const bool transpose_in, const bool transpose_out,
544 const int leading_dimension_in,
545 const int leading_dimension_out, double *grid_in,
546 double complex *grid_out) {
547 fft_1d_r2c_local(fft_size, number_of_ffts, transpose_in, transpose_out,
548 leading_dimension_in, leading_dimension_out, grid_in,
549 grid_out);
550}
551
552/*******************************************************************************
553 * \brief Fortran interface for fft_1d_c2r_local.
554 *
555 * \param fft_size Size of the transform in each dimension.
556 * \param number_of_ffts Number of independent transforms (batch size).
557 * \param transpose_in Whether the input has the transposed layout.
558 * \param transpose_out Whether the output has the transposed layout.
559 * \param leading_dimension_in Leading dimension of the input buffer.
560 * \param leading_dimension_out Leading dimension of the output buffer.
561 * \param grid_in Input grid buffer.
562 * \param grid_out Output grid buffer.
563 * \author Frederick Stein
564 ******************************************************************************/
565void fft_1d_c2r_local_F(const int fft_size, const int number_of_ffts,
566 const bool transpose_in, const bool transpose_out,
567 const int leading_dimension_in,
568 const int leading_dimension_out,
569 double complex *grid_in, double *grid_out) {
570 fft_1d_c2r_local(fft_size, number_of_ffts, transpose_in, transpose_out,
571 leading_dimension_in, leading_dimension_out, grid_in,
572 grid_out);
573}
574
575/*******************************************************************************
576 * \brief Fortran interface for fft_2d_r2c_local.
577 *
578 * \param fft_size Size of the transform in each dimension.
579 * \param number_of_ffts Number of independent transforms (batch size).
580 * \param transpose_in Whether the input has the transposed layout.
581 * \param transpose_out Whether the output has the transposed layout.
582 * \param grid_in Input grid buffer.
583 * \param grid_out Output grid buffer.
584 * \author Frederick Stein
585 ******************************************************************************/
586void fft_2d_r2c_local_F(const int fft_size[2], const int number_of_ffts,
587 const bool transpose_in, const bool transpose_out,
588 double *grid_in, double complex *grid_out) {
589 fft_2d_r2c_local((const int[]){fft_size[1], fft_size[0]}, number_of_ffts,
590 transpose_in, transpose_out, grid_in, grid_out);
591}
592
593/*******************************************************************************
594 * \brief Fortran interface for fft_2d_c2r_local.
595 *
596 * \param fft_size Size of the transform in each dimension.
597 * \param number_of_ffts Number of independent transforms (batch size).
598 * \param transpose_in Whether the input has the transposed layout.
599 * \param transpose_out Whether the output has the transposed layout.
600 * \param grid_in Input grid buffer.
601 * \param grid_out Output grid buffer.
602 * \author Frederick Stein
603 ******************************************************************************/
604void fft_2d_c2r_local_F(const int fft_size[2], const int number_of_ffts,
605 const bool transpose_in, const bool transpose_out,
606 double complex *grid_in, double *grid_out) {
607 fft_2d_c2r_local((const int[]){fft_size[1], fft_size[0]}, number_of_ffts,
608 transpose_in, transpose_out, grid_in, grid_out);
609}
610
611/*******************************************************************************
612 * \brief Fortran interface for fft_3d_r2c_local.
613 *
614 * \param fft_size Size of the transform in each dimension.
615 * \param number_of_ffts Number of independent transforms (batch size).
616 * \param transpose_in Whether the input has the transposed layout.
617 * \param transpose_out Whether the output has the transposed layout.
618 * \param grid_in Input grid buffer.
619 * \param grid_out Output grid buffer.
620 * \author Frederick Stein
621 ******************************************************************************/
622void fft_3d_r2c_local_F(const int fft_size[3], const int number_of_ffts,
623 const bool transpose_in, const bool transpose_out,
624 double *grid_in, double complex *grid_out) {
625 fft_3d_r2c_local((const int[]){fft_size[2], fft_size[1], fft_size[0]},
626 number_of_ffts, transpose_in, transpose_out, grid_in,
627 grid_out);
628}
629
630/*******************************************************************************
631 * \brief Fortran interface for fft_3d_c2r_local.
632 *
633 * \param fft_size Size of the transform in each dimension.
634 * \param number_of_ffts Number of independent transforms (batch size).
635 * \param transpose_in Whether the input has the transposed layout.
636 * \param transpose_out Whether the output has the transposed layout.
637 * \param grid_in Input grid buffer.
638 * \param grid_out Output grid buffer.
639 * \author Frederick Stein
640 ******************************************************************************/
641void fft_3d_c2r_local_F(const int fft_size[3], const int number_of_ffts,
642 const bool transpose_in, const bool transpose_out,
643 double complex *grid_in, double *grid_out) {
644 fft_3d_c2r_local((const int[]){fft_size[2], fft_size[1], fft_size[0]},
645 number_of_ffts, transpose_in, transpose_out, grid_in,
646 grid_out);
647}
648
649/*******************************************************************************
650 * \brief Fortran interface for fft_register_1d_r2c_local_inplace.
651 *
652 * \param fft_size Size of the transform in each dimension.
653 * \param number_of_ffts Number of independent transforms (batch size).
654 * \param transpose Whether the in-place buffer has the transposed layout.
655 * \param leading_dimension Leading dimension of the in-place buffer.
656 * \param grid In-place grid buffer.
657 * \author Frederick Stein
658 ******************************************************************************/
660 const int number_of_ffts,
661 const bool transpose,
662 const int leading_dimension,
663 double *grid) {
664 fft_register_1d_r2c_local(fft_size, number_of_ffts, transpose, transpose,
665 leading_dimension, leading_dimension / 2, grid,
666 (double complex *)grid);
667}
668
669/*******************************************************************************
670 * \brief Fortran interface for fft_register_1d_c2r_local_inplace.
671 *
672 * \param fft_size Size of the transform in each dimension.
673 * \param number_of_ffts Number of independent transforms (batch size).
674 * \param transpose Whether the in-place buffer has the transposed layout.
675 * \param leading_dimension Leading dimension of the in-place buffer.
676 * \param grid In-place grid buffer.
677 * \author Frederick Stein
678 ******************************************************************************/
680 const int number_of_ffts,
681 const bool transpose,
682 const int leading_dimension,
683 double *grid) {
684 fft_register_1d_c2r_local(fft_size, number_of_ffts, transpose, transpose,
685 leading_dimension / 2, leading_dimension,
686 (double complex *)grid, grid);
687}
688
689/*******************************************************************************
690 * \brief Fortran interface for fft_register_2d_r2c_local_inplace.
691 *
692 * \param fft_size Size of the transform in each dimension.
693 * \param number_of_ffts Number of independent transforms (batch size).
694 * \param transpose Whether the in-place buffer has the transposed layout.
695 * \param grid In-place grid buffer.
696 * \author Frederick Stein
697 ******************************************************************************/
698void fft_register_2d_r2c_local_inplace_F(const int fft_size[2],
699 const int number_of_ffts,
700 const bool transpose, double *grid) {
701 fft_register_2d_r2c_local((const int[]){fft_size[1], fft_size[0]},
702 number_of_ffts, transpose, transpose, grid,
703 (double complex *)grid);
704}
705
706/*******************************************************************************
707 * \brief Fortran interface for fft_register_2d_c2r_local_inplace.
708 *
709 * \param fft_size Size of the transform in each dimension.
710 * \param number_of_ffts Number of independent transforms (batch size).
711 * \param transpose Whether the in-place buffer has the transposed layout.
712 * \param grid In-place grid buffer.
713 * \author Frederick Stein
714 ******************************************************************************/
715void fft_register_2d_c2r_local_inplace_F(const int fft_size[2],
716 const int number_of_ffts,
717 const bool transpose, double *grid) {
718 fft_register_2d_c2r_local((const int[]){fft_size[1], fft_size[0]},
719 number_of_ffts, transpose, transpose,
720 (double complex *)grid, grid);
721}
722
723/*******************************************************************************
724 * \brief Fortran interface for fft_register_3d_r2c_local_inplace.
725 *
726 * \param fft_size Size of the transform in each dimension.
727 * \param number_of_ffts Number of independent transforms (batch size).
728 * \param transpose Whether the in-place buffer has the transposed layout.
729 * \param grid In-place grid buffer.
730 * \author Frederick Stein
731 ******************************************************************************/
732void fft_register_3d_r2c_local_inplace_F(const int fft_size[3],
733 const int number_of_ffts,
734 const bool transpose, double *grid) {
736 (const int[]){fft_size[2], fft_size[1], fft_size[0]}, number_of_ffts,
737 transpose, transpose, grid, (double complex *)grid);
738}
739
740/*******************************************************************************
741 * \brief Fortran interface for fft_register_3d_c2r_local_inplace.
742 *
743 * \param fft_size Size of the transform in each dimension.
744 * \param number_of_ffts Number of independent transforms (batch size).
745 * \param transpose Whether the in-place buffer has the transposed layout.
746 * \param grid In-place grid buffer.
747 * \author Frederick Stein
748 ******************************************************************************/
749void fft_register_3d_c2r_local_inplace_F(const int fft_size[3],
750 const int number_of_ffts,
751 const bool transpose, double *grid) {
753 (const int[]){fft_size[2], fft_size[1], fft_size[0]}, number_of_ffts,
754 transpose, transpose, (double complex *)grid, grid);
755}
756
757/*******************************************************************************
758 * \brief Fortran interface for fft_1d_r2c_local_inplace.
759 *
760 * \param fft_size Size of the transform in each dimension.
761 * \param number_of_ffts Number of independent transforms (batch size).
762 * \param transpose Whether the in-place buffer has the transposed layout.
763 * \param leading_dimension Leading dimension of the in-place buffer.
764 * \param grid In-place grid buffer.
765 * \author Frederick Stein
766 ******************************************************************************/
767void fft_1d_r2c_local_inplace_F(const int fft_size, const int number_of_ffts,
768 const bool transpose,
769 const int leading_dimension, double *grid) {
770 fft_1d_r2c_local(fft_size, number_of_ffts, transpose, transpose,
771 leading_dimension, leading_dimension / 2, grid,
772 (double complex *)grid);
773}
774
775/*******************************************************************************
776 * \brief Fortran interface for fft_1d_c2r_local_inplace.
777 *
778 * \param fft_size Size of the transform in each dimension.
779 * \param number_of_ffts Number of independent transforms (batch size).
780 * \param transpose Whether the in-place buffer has the transposed layout.
781 * \param leading_dimension Leading dimension of the in-place buffer.
782 * \param grid In-place grid buffer.
783 * \author Frederick Stein
784 ******************************************************************************/
785void fft_1d_c2r_local_inplace_F(const int fft_size, const int number_of_ffts,
786 const bool transpose,
787 const int leading_dimension, double *grid) {
788 fft_1d_c2r_local(fft_size, number_of_ffts, transpose, transpose,
789 leading_dimension / 2, leading_dimension,
790 (double complex *)grid, grid);
791}
792
793/*******************************************************************************
794 * \brief Fortran interface for fft_2d_r2c_local_inplace.
795 *
796 * \param fft_size Size of the transform in each dimension.
797 * \param number_of_ffts Number of independent transforms (batch size).
798 * \param transpose Whether the in-place buffer has the transposed layout.
799 * \param grid In-place grid buffer.
800 * \author Frederick Stein
801 ******************************************************************************/
802void fft_2d_r2c_local_inplace_F(const int fft_size[2], const int number_of_ffts,
803 const bool transpose, double *grid) {
804 fft_2d_r2c_local((const int[]){fft_size[1], fft_size[0]}, number_of_ffts,
805 transpose, transpose, grid, (double complex *)grid);
806}
807
808/*******************************************************************************
809 * \brief Fortran interface for fft_2d_c2r_local_inplace.
810 *
811 * \param fft_size Size of the transform in each dimension.
812 * \param number_of_ffts Number of independent transforms (batch size).
813 * \param transpose Whether the in-place buffer has the transposed layout.
814 * \param grid In-place grid buffer.
815 * \author Frederick Stein
816 ******************************************************************************/
817void fft_2d_c2r_local_inplace_F(const int fft_size[2], const int number_of_ffts,
818 const bool transpose, double *grid) {
819 fft_2d_c2r_local((const int[]){fft_size[1], fft_size[0]}, number_of_ffts,
820 transpose, transpose, (double complex *)grid, grid);
821}
822
823/*******************************************************************************
824 * \brief Fortran interface for fft_3d_r2c_local_inplace.
825 *
826 * \param fft_size Size of the transform in each dimension.
827 * \param number_of_ffts Number of independent transforms (batch size).
828 * \param transpose Whether the in-place buffer has the transposed layout.
829 * \param grid In-place grid buffer.
830 * \author Frederick Stein
831 ******************************************************************************/
832void fft_3d_r2c_local_inplace_F(const int fft_size[3], const int number_of_ffts,
833 const bool transpose, double *grid) {
834 fft_3d_r2c_local((const int[]){fft_size[2], fft_size[1], fft_size[0]},
835 number_of_ffts, transpose, transpose, grid,
836 (double complex *)grid);
837}
838
839/*******************************************************************************
840 * \brief Fortran interface for fft_3d_c2r_local_inplace.
841 *
842 * \param fft_size Size of the transform in each dimension.
843 * \param number_of_ffts Number of independent transforms (batch size).
844 * \param transpose Whether the in-place buffer has the transposed layout.
845 * \param grid In-place grid buffer.
846 * \author Frederick Stein
847 ******************************************************************************/
848void fft_3d_c2r_local_inplace_F(const int fft_size[3], const int number_of_ffts,
849 const bool transpose, double *grid) {
850 fft_3d_c2r_local((const int[]){fft_size[2], fft_size[1], fft_size[0]},
851 number_of_ffts, transpose, transpose, (double complex *)grid,
852 grid);
853}
854
855// EOF
cp_mpi_comm_t cp_mpi_comm_f2c(const int fortran_comm)
Wrapper around MPI_Comm_f2c.
Definition cp_mpi.c:162
static void print_func(const char *msg, int msglen, int output_unit)
Wrapper for printf, passed to dbm_library_print_stats.
Definition dbm_miniapp.c:26
void fft_2d_c2r_local_F(const int fft_size[2], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double complex *grid_in, double *grid_out)
Fortran interface for fft_2d_c2r_local.
Definition fft_api_F.c:604
void fft_register_3d_c2r_local_F(const int fft_size[3], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double complex *grid_in, double *grid_out)
Fortran interface for fft_register_3d_c2r_local.
Definition fft_api_F.c:519
void fft_register_3d_r2c_local_inplace_F(const int fft_size[3], const int number_of_ffts, const bool transpose, double *grid)
Fortran interface for fft_register_3d_r2c_local_inplace.
Definition fft_api_F.c:732
void fft_1d_c2r_local_inplace_F(const int fft_size, const int number_of_ffts, const bool transpose, const int leading_dimension, double *grid)
Fortran interface for fft_1d_c2r_local_inplace.
Definition fft_api_F.c:785
void fft_register_3d_r2c_local_F(const int fft_size[3], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double *grid_in, double complex *grid_out)
Fortran interface for fft_register_3d_r2c_local.
Definition fft_api_F.c:498
void fft_1d_r2c_local_inplace_F(const int fft_size, const int number_of_ffts, const bool transpose, const int leading_dimension, double *grid)
Fortran interface for fft_1d_r2c_local_inplace.
Definition fft_api_F.c:767
void fft_1d_local_F(const bool dir, const int fft_size, const int number_of_ffts, const bool transpose_in, const bool transpose_out, const int leading_dimension_in, const int leading_dimension_out, double complex *grid_in, double complex *grid_out)
Fortran interface for fft_1d_local.
Definition fft_api_F.c:296
void fft_1d_c2r_local_F(const int fft_size, const int number_of_ffts, const bool transpose_in, const bool transpose_out, const int leading_dimension_in, const int leading_dimension_out, double complex *grid_in, double *grid_out)
Fortran interface for fft_1d_c2r_local.
Definition fft_api_F.c:565
void fft_2d_r2c_local_F(const int fft_size[2], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double *grid_in, double complex *grid_out)
Fortran interface for fft_2d_r2c_local.
Definition fft_api_F.c:586
void fft_register_3d_c2r_local_inplace_F(const int fft_size[3], const int number_of_ffts, const bool transpose, double *grid)
Fortran interface for fft_register_3d_c2r_local_inplace.
Definition fft_api_F.c:749
void fft_print_timing_report_F(const double threshold, const int fortran_comm)
Fortran interface for fft_print_timing_report.
Definition fft_api_F.c:79
void fft_register_3d_local_inplace_F(const bool dir, const int fft_size[3], const int number_of_ffts, const bool transpose, double complex *grid)
Fortran interface for fft_register_3d_local_inplace.
Definition fft_api_F.c:273
void fft_2d_c2r_local_inplace_F(const int fft_size[2], const int number_of_ffts, const bool transpose, double *grid)
Fortran interface for fft_2d_c2r_local_inplace.
Definition fft_api_F.c:817
void fft_3d_r2c_local_inplace_F(const int fft_size[3], const int number_of_ffts, const bool transpose, double *grid)
Fortran interface for fft_3d_r2c_local_inplace.
Definition fft_api_F.c:832
void fft_print_timing_report_unit_F(const double threshold, fft_print_func_t print_func, const int output_unit, const int fortran_comm)
Fortran interface for fft_print_timing_report_unit.
Definition fft_api_F.c:92
void fft_free_double_F(double *buffer)
Allocate buffer of type double.
Definition fft_api_F.c:125
void fft_register_2d_r2c_local_F(const int fft_size[2], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double *grid_in, double complex *grid_out)
Fortran interface for fft_register_2d_r2c_local.
Definition fft_api_F.c:456
void fft_register_1d_local_inplace_F(const bool dir, const int fft_size, const int number_of_ffts, const bool transpose, const int leading_dimension, double complex *grid)
Fortran interface for fft_register_1d_local_inplace.
Definition fft_api_F.c:236
void fft_allocate_complex_F(const int length, double complex **buffer)
Allocate buffer of type double complex.
Definition fft_api_F.c:116
int fft_backend_in_use_F()
Fortran interface for fft_backend_in_use.
Definition fft_api_F.c:139
void fft_register_3d_local_F(const bool dir, const int fft_size[3], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double complex *grid_in, double complex *grid_out)
Fortran interface for fft_register_3d_local.
Definition fft_api_F.c:216
void fft_library_finalize_F(const char *wisdom_file)
Fortran interface for fft_library_finalize.
Definition fft_api_F.c:67
void fft_allocate_double_F(const int length, double **buffer)
Allocate buffer of type double.
Definition fft_api_F.c:106
void fft_register_1d_local_F(const bool dir, const int fft_size, const int number_of_ffts, const bool transpose_in, const bool transpose_out, const int leading_dimension_in, const int leading_dimension_out, double complex *grid_in, double complex *grid_out)
Fortran interface for fft_register_1d_local.
Definition fft_api_F.c:171
void fft_3d_local_inplace_F(const bool dir, const int fft_size[3], const int number_of_ffts, const bool transpose, double complex *grid)
Fortran interface for fft_3d_local_inplace.
Definition fft_api_F.c:390
void fft_register_2d_local_F(const bool dir, const int fft_size[2], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double complex *grid_in, double complex *grid_out)
Fortran interface for fft_register_2d_local.
Definition fft_api_F.c:195
void fft_register_2d_r2c_local_inplace_F(const int fft_size[2], const int number_of_ffts, const bool transpose, double *grid)
Fortran interface for fft_register_2d_r2c_local_inplace.
Definition fft_api_F.c:698
void fft_3d_c2r_local_inplace_F(const int fft_size[3], const int number_of_ffts, const bool transpose, double *grid)
Fortran interface for fft_3d_c2r_local_inplace.
Definition fft_api_F.c:848
void fft_register_2d_c2r_local_F(const int fft_size[2], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double complex *grid_in, double *grid_out)
Fortran interface for fft_register_2d_c2r_local.
Definition fft_api_F.c:477
void fft_2d_local_inplace_F(const bool dir, const int fft_size[2], const int number_of_ffts, const bool transpose, double complex *grid)
Fortran interface for fft_2d_local_inplace.
Definition fft_api_F.c:373
void fft_register_1d_c2r_local_inplace_F(const int fft_size, const int number_of_ffts, const bool transpose, const int leading_dimension, double *grid)
Fortran interface for fft_register_1d_c2r_local_inplace.
Definition fft_api_F.c:679
void fft_3d_local_F(const bool dir, const int fft_size[3], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double complex *grid_in, double complex *grid_out)
Fortran interface for fft_3d_local.
Definition fft_api_F.c:337
void fft_2d_r2c_local_inplace_F(const int fft_size[2], const int number_of_ffts, const bool transpose, double *grid)
Fortran interface for fft_2d_r2c_local_inplace.
Definition fft_api_F.c:802
void fft_3d_r2c_local_F(const int fft_size[3], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double *grid_in, double complex *grid_out)
Fortran interface for fft_3d_r2c_local.
Definition fft_api_F.c:622
void fft_2d_local_F(const bool dir, const int fft_size[2], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double complex *grid_in, double complex *grid_out)
Fortran interface for fft_2d_local.
Definition fft_api_F.c:317
void fft_register_2d_c2r_local_inplace_F(const int fft_size[2], const int number_of_ffts, const bool transpose, double *grid)
Fortran interface for fft_register_2d_c2r_local_inplace.
Definition fft_api_F.c:715
void fft_register_2d_local_inplace_F(const bool dir, const int fft_size[2], const int number_of_ffts, const bool transpose, double complex *grid)
Fortran interface for fft_register_2d_local_inplace.
Definition fft_api_F.c:255
void fft_register_1d_r2c_local_F(const int fft_size, const int number_of_ffts, const bool transpose_in, const bool transpose_out, const int leading_dimension_in, const int leading_dimension_out, double *grid_in, double complex *grid_out)
Fortran interface for fft_register_1d_r2c_local.
Definition fft_api_F.c:410
bool fft_has_guru_interface_F()
Fortran interface for fft_has_guru_interface.
Definition fft_api_F.c:155
void fft_free_complex_F(double complex *buffer)
Allocate buffer of type double complex.
Definition fft_api_F.c:132
void fft_1d_local_inplace_F(const bool dir, const int fft_size, const int number_of_ffts, const bool transpose, const int leading_dimension, double complex *grid)
Fortran interface for fft_1d_local_inplace.
Definition fft_api_F.c:356
void fft_register_1d_r2c_local_inplace_F(const int fft_size, const int number_of_ffts, const bool transpose, const int leading_dimension, double *grid)
Fortran interface for fft_register_1d_r2c_local_inplace.
Definition fft_api_F.c:659
int fft_library_init_F(const int backend_F, const int fftw_plan, const bool use_guru_interface, const char *wisdom_file)
Fortran interface for fft_library_init.
Definition fft_api_F.c:25
void fft_3d_c2r_local_F(const int fft_size[3], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double complex *grid_in, double *grid_out)
Fortran interface for fft_3d_c2r_local.
Definition fft_api_F.c:641
void fft_register_1d_c2r_local_F(const int fft_size, const int number_of_ffts, const bool transpose_in, const bool transpose_out, const int leading_dimension_in, const int leading_dimension_out, double complex *grid_in, double *grid_out)
Fortran interface for fft_register_1d_c2r_local.
Definition fft_api_F.c:434
void fft_1d_r2c_local_F(const int fft_size, const int number_of_ffts, const bool transpose_in, const bool transpose_out, const int leading_dimension_in, const int leading_dimension_out, double *grid_in, double complex *grid_out)
Fortran interface for fft_1d_r2c_local.
Definition fft_api_F.c:542
#define FFT_LIBRARY_BACKEND_DEFAULT
Definition fft_api_F.h:14
#define FFT_LIBRARY_FFTW_MODE_EXHAUSTIVE
Definition fft_api_F.h:20
#define FFT_LIBRARY_FFTW_MODE_ESTIMATE
Definition fft_api_F.h:17
#define FFT_LIBRARY_FFTW_MODE_MEASURE
Definition fft_api_F.h:18
#define FFT_LIBRARY_BACKEND_GPU
Definition fft_api_F.h:16
#define FFT_LIBRARY_BACKEND_FFTW
Definition fft_api_F.h:15
void(* fft_print_func_t)(const char *, int, int)
Definition fft_api_F.h:42
#define FFT_LIBRARY_FFTW_MODE_PATIENT
Definition fft_api_F.h:19
void fft_3d_r2c_local(const int fft_size[3], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double *grid_in, double complex *grid_out)
Perform a local 3D R2C FFT.
Definition fft_lib.c:712
void fft_2d_r2c_local(const int fft_size[2], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double *grid_in, double complex *grid_out)
Perform a local 2D R2C FFT.
Definition fft_lib.c:630
void fft_1d_local(const bool dir, const int fft_size, const int number_of_ffts, const bool transpose_in, const bool transpose_out, const int leading_dimension_in, const int leading_dimension_out, double complex *grid_in, double complex *grid_out)
Perform a local 1D FFT.
Definition fft_lib.c:506
void fft_1d_r2c_local(const int fft_size, const int number_of_ffts, const bool transpose_in, const bool transpose_out, const int leading_dimension_in, const int leading_dimension_out, double *grid_in, double complex *grid_out)
Perform a local 1D R2C FFT.
Definition fft_lib.c:538
void fft_register_1d_r2c_local(const int fft_size, const int number_of_ffts, const bool transpose_in, const bool transpose_out, const int leading_dimension_in, const int leading_dimension_out, double *grid_in, double complex *grid_out)
Register a local 1D R2C FFT.
Definition fft_lib.c:266
void fft_2d_local(const bool dir, const int fft_size[2], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double complex *grid_in, double complex *grid_out)
Perform a local 2D FFT.
Definition fft_lib.c:603
void fft_finalize_lib(const char *wisdom_file)
Finalize the FFT library (if not done externally).
Definition fft_lib.c:134
void fft_register_2d_r2c_local(const int fft_size[2], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double *grid_in, double complex *grid_out)
Register a local 2D R2C FFT.
Definition fft_lib.c:361
void fft_register_2d_c2r_local(const int fft_size[2], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double complex *grid_in, double *grid_out)
Register a local 2D C2R FFT.
Definition fft_lib.c:389
void fft_free_complex(double complex *buffer)
Allocate buffer of type double complex.
Definition fft_lib.c:210
bool fft_lib_has_guru_interface()
Whether a compound MPI implementation is available.
Definition fft_lib.c:156
int fft_init_lib(const fft_lib lib, const int fftw_planning_flag, const bool use_guru_interface, const char *wisdom_file)
Initialize the FFT library (if not done externally).
Definition fft_lib.c:84
void fft_register_1d_local(const bool dir, const int fft_size, const int number_of_ffts, const bool transpose_in, const bool transpose_out, const int leading_dimension_in, const int leading_dimension_out, double complex *grid_in, double complex *grid_out)
Register a local 1D C2C FFT.
Definition fft_lib.c:233
int fft_lib_backend_in_use()
Whether a compound MPI implementation is available.
Definition fft_lib.c:150
void fft_2d_c2r_local(const int fft_size[2], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double complex *grid_in, double *grid_out)
Perform a local 2D C2R FFT.
Definition fft_lib.c:657
void fft_free_double(double *buffer)
Allocate buffer of type double.
Definition fft_lib.c:195
void fft_3d_c2r_local(const int fft_size[3], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double complex *grid_in, double *grid_out)
Perform a local 3D C2R FFT.
Definition fft_lib.c:739
void fft_allocate_double(const int length, double **buffer)
Allocate buffer of type double.
Definition fft_lib.c:174
void fft_register_3d_local(const bool dir, const int fft_size[3], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double complex *grid_in, double complex *grid_out)
Register a local 3D FFT.
Definition fft_lib.c:420
void fft_3d_local(const bool dir, const int fft_size[3], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double complex *grid_in, double complex *grid_out)
Perform a local 3D FFT.
Definition fft_lib.c:685
void fft_register_2d_local(const bool dir, const int fft_size[2], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double complex *grid_in, double complex *grid_out)
Register a local 2D FFT.
Definition fft_lib.c:333
void fft_1d_c2r_local(const int fft_size, const int number_of_ffts, const bool transpose_in, const bool transpose_out, const int leading_dimension_in, const int leading_dimension_out, double complex *grid_in, double *grid_out)
Perform a local 1D C2R FFT.
Definition fft_lib.c:571
void fft_register_1d_c2r_local(const int fft_size, const int number_of_ffts, const bool transpose_in, const bool transpose_out, const int leading_dimension_in, const int leading_dimension_out, double complex *grid_in, double *grid_out)
Register a local 1D C2R FFT.
Definition fft_lib.c:300
void fft_register_3d_c2r_local(const int fft_size[3], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double complex *grid_in, double *grid_out)
Register a local 3D C2R FFT.
Definition fft_lib.c:475
void fft_register_3d_r2c_local(const int fft_size[3], const int number_of_ffts, const bool transpose_in, const bool transpose_out, double *grid_in, double complex *grid_out)
Register a local 3D R2C FFT.
Definition fft_lib.c:447
void fft_allocate_complex(const int length, double complex **buffer)
Allocate buffer of type double complex.
Definition fft_lib.c:185
fft_lib
Definition fft_lib.h:16
@ FFT_LIB_FFTW
Definition fft_lib.h:16
@ FFT_LIB_GPU
Definition fft_lib.h:16
@ FFT_LIB_DEFAULT
Definition fft_lib.h:16
fftw_plan_type
@ FFT_PATIENT
@ FFT_MEASURE
@ FFT_EXHAUSTIVE
@ FFT_ESTIMATE
void fft_print_timing_report_unit(const double threshold, fft_print_func_t print_func, const int output_unit, const cp_mpi_comm_t comm)
Prints the timing report.
Definition fft_timer.c:253
void fft_print_timing_report(const double threshold, const cp_mpi_comm_t comm)
Print the FFT timing report to standard output.
Definition fft_timer.c:357
void fft_finalize_timer()
Finalizes the internal timer.
Definition fft_timer.c:367
static void const int const int const int const int const int const double const int const int const int int GRID_CONST_WHEN_COLLOCATE double GRID_CONST_WHEN_INTEGRATE double * grid