mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches
templateCufft.hpp
Go to the documentation of this file.
1/** \file templateCufft.hpp
2 * \author Jared R. Males
3 * \brief A template interface to cufft
4 * \ingroup cuda_files
5 *
6 */
7
8//***********************************************************************//
9// Copyright 2019,2020 Jared R. Males (jaredmales@gmail.com)
10//
11// This file is part of mxlib.
12//
13// mxlib is free software: you can redistribute it and/or modify
14// it under the terms of the GNU General Public License as published by
15// the Free Software Foundation, either version 3 of the License, or
16// (at your option) any later version.
17//
18// mxlib is distributed in the hope that it will be useful,
19// but WITHOUT ANY WARRANTY; without even the implied warranty of
20// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21// GNU General Public License for more details.
22//
23// You should have received a copy of the GNU General Public License
24// along with mxlib. If not, see <http://www.gnu.org/licenses/>.
25//***********************************************************************//
26
27#ifndef math_templateCufft_hpp
28#define math_templateCufft_hpp
29
30#ifdef MXLIB_CUDA
31
32#include <complex>
33#include <cuda_runtime.h>
34#include <cufft.h>
35
36namespace mx
37{
38namespace cuda
39{
40
41/*
42template <typename inputT, typename outputT>
43cufftResult cufftPlan1d( cufftHandle *plan, int nx);
44
45template <>
46cufftResult cufftPlan1d<cuComplex, cuComplex>( cufftHandle *plan, int nx );
47
48template <>
49cufftResult cufftPlan1d<cuComplex, cuComplex>( cufftHandle *plan, int nx );
50*/
51
52template <typename inputT, typename outputT>
53cufftResult cufftPlan2d( cufftHandle *plan, int nx, int ny );
54
55template <>
56cufftResult cufftPlan2d<cuDoubleComplex, cuDoubleComplex>( cufftHandle *plan, int nx, int ny );
57
58template <>
59cufftResult cufftPlan2d<cuDoubleComplex, cuDoubleComplex>( cufftHandle *plan, int nx, int ny );
60
61template <typename inputT, typename outputT>
62cufftResult cufftExec( cufftHandle plan, inputT *idata, inputT *odata, int direction );
63
64template <>
65cufftResult cufftExec<cuComplex, cuComplex>( cufftHandle plan,
66 cuComplex *idata,
67 cuComplex *odata,
68 int direction );
69
70template <>
71cufftResult cufftExec<cuComplex, cuComplex>( cufftHandle plan, cuComplex *idata, cuComplex *odata, int direction );
72
73template <>
74cufftResult cufftExec<cuDoubleComplex, cuDoubleComplex>( cufftHandle plan,
75 cuDoubleComplex *idata,
76 cuDoubleComplex *odata,
77 int direction );
78
79template <>
80cufftResult cufftExec<cuDoubleComplex, cuDoubleComplex>( cufftHandle plan,
81 cuDoubleComplex *idata,
82 cuDoubleComplex *odata,
83 int direction );
84
85} // namespace cuda
86} // namespace mx
87
88#endif //MXLIB_CUDA
89
90#endif // math_templateCufft_hpp
The mxlib c++ namespace.
Definition mxlib.hpp:37