starpufft.h 2.6 KB

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