StarPU Handbook

starpufft.h
Go to the documentation of this file.
1/* StarPU --- Runtime system for heterogeneous multicore architectures.
2 *
3 * Copyright (C) 2009-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
4 *
5 * StarPU is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published by
7 * the Free Software Foundation; either version 2.1 of the License, or (at
8 * your option) any later version.
9 *
10 * StarPU is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 *
14 * See the GNU Lesser General Public License in COPYING.LGPL for more details.
15 */
16
17// The documentation for this file is in doc/doxygen/chapters/api/fft_support.doxy
18
19#ifndef __STARPU_FFT_H__
20#define __STARPU_FFT_H__
21
22#include <stdio.h>
23#include <complex.h>
24#include <starpu.h>
25#ifdef STARPU_USE_CUDA
26#include <cufft.h>
27#define STARPU_CUFFT_REPORT_ERROR(status) STARPUFFT(report_error)(__starpu_func__, __FILE__, __LINE__, status)
28#endif /* !STARPU_USE_CUDA */
29
30#define STARPUFFT_FORWARD -1
31#define STARPUFFT_INVERSE 1
32
33#define __STARPUFFT(name) starpufft_##name
34#define __STARPUFFTF(name) starpufftf_##name
35#define __STARPUFFTL(name) starpufftl_##name
36
37#define __STARPUFFT_INTERFACE(starpufft,real) \
38 typedef real _Complex starpufft(complex); \
39\
40 typedef struct starpufft(plan) *starpufft(plan); \
41\
42 starpufft(plan) starpufft(plan_dft_1d)(int n, int sign, unsigned flags); \
43 starpufft(plan) starpufft(plan_dft_2d)(int n, int m, int sign, unsigned flags); \
44 starpufft(plan) starpufft(plan_dft_3d)(int n, int m, int p, int sign, unsigned flags); \
45 starpufft(plan) starpufft(plan_dft_r2c_1d)(int n, unsigned flags); \
46 starpufft(plan) starpufft(plan_dft_c2r_1d)(int n, unsigned flags); \
47\
48 void *starpufft(malloc)(size_t n); \
49 void starpufft(free)(void *p); \
50\
51 int starpufft(execute)(starpufft(plan) p, void *in, void *out); \
52 struct starpu_task *starpufft(start)(starpufft(plan) p, void *in, void *out); \
53\
54 int starpufft(execute_handle)(starpufft(plan) p, starpu_data_handle_t in, starpu_data_handle_t out); \
55 struct starpu_task *starpufft(start_handle)(starpufft(plan) p, starpu_data_handle_t in, starpu_data_handle_t out); \
56\
57 void starpufft(cleanup)(starpufft(plan) p); \
58 void starpufft(destroy_plan)(starpufft(plan) p); \
59\
60 void starpufft(startstats)(void); \
61 void starpufft(stopstats)(void); \
62 void starpufft(showstats)(FILE *out);
63
64__STARPUFFT_INTERFACE(__STARPUFFT, double)
65__STARPUFFT_INTERFACE(__STARPUFFTF, float)
66__STARPUFFT_INTERFACE(__STARPUFFTL, long double)
67
68/* Internal use */
69 extern int starpufft_last_plan_number;
70
71#endif // __STARPU_FFT_H__
starpu.h