starpufft-double.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. #include <starpu_config.h>
  17. #if defined(STARPU_HAVE_FFTW) && !defined(__CUDACC__)
  18. #include <complex.h>
  19. #include <fftw3.h>
  20. #endif
  21. #ifdef STARPU_USE_CUDA
  22. #include <cufft.h>
  23. #endif
  24. #undef STARPUFFT_FLOAT
  25. #define STARPUFFT_DOUBLE
  26. typedef double real;
  27. #if defined(STARPU_HAVE_FFTW) && !defined(__CUDACC__)
  28. typedef fftw_complex _fftw_complex;
  29. typedef fftw_plan _fftw_plan;
  30. #endif
  31. #ifdef STARPU_USE_CUDA
  32. typedef cuDoubleComplex _cuComplex;
  33. typedef cufftDoubleComplex _cufftComplex;
  34. #define _cufftExecC2C cufftExecZ2Z
  35. #define _cufftExecR2C cufftExecD2Z
  36. #define _cufftExecC2R cufftExecZ2D
  37. #define _CUFFT_C2C CUFFT_Z2Z
  38. #define _CUFFT_R2C CUFFT_D2Z
  39. #define _CUFFT_C2R CUFFT_Z2D
  40. #define _cuCmul(x,y) cuCmul(x,y)
  41. #endif
  42. #define STARPUFFT(name) starpufft_##name
  43. #define _FFTW(name) fftw_##name
  44. #ifdef STARPU_USE_CUDA
  45. void STARPUFFT(report_error)(const char *func, const char *file, int line, cufftResult status);
  46. #endif /* !STARPU_USE_CUDA */
  47. #define TYPE ""