JayBeams  0.1
Another project to have fun coding.
complex_traits.hpp
Go to the documentation of this file.
1 #ifndef jb_clfft_complex_traits_hpp
2 #define jb_clfft_complex_traits_hpp
3 
4 #include <jb/clfft/init.hpp>
5 
6 #include <complex>
7 
8 namespace jb {
9 namespace clfft {
10 namespace detail {
11 
12 /**
13  * Generic version, not implemented.
14  */
15 template <typename T>
16 struct complex_traits {};
17 
18 /**
19  * Define traits for std::complex<float> as needed in jb::clfft::plan
20  */
21 template <>
22 struct complex_traits<std::complex<float>> {
23  static clfftPrecision constexpr precision = CLFFT_SINGLE;
24  static clfftLayout constexpr layout = CLFFT_COMPLEX_INTERLEAVED;
25 };
26 
27 /**
28  * Define traits for std::complex<double> as needed in jb::clfft::plan
29  */
30 template <>
31 struct complex_traits<std::complex<double>> {
32  static clfftPrecision constexpr precision = CLFFT_DOUBLE;
33  static clfftLayout constexpr layout = CLFFT_COMPLEX_INTERLEAVED;
34 };
35 
36 /**
37  * Define traits for float as needed in jb::clfft::plan
38  */
39 template <>
40 struct complex_traits<float> {
41  static clfftPrecision constexpr precision = CLFFT_SINGLE;
42  static clfftLayout constexpr layout = CLFFT_REAL;
43 };
44 
45 /**
46  * Define traits for double as needed in jb::clfft::plan
47  */
48 template <>
49 struct complex_traits<double> {
50  static clfftPrecision constexpr precision = CLFFT_DOUBLE;
51  static clfftLayout constexpr layout = CLFFT_REAL;
52 };
53 
54 } // namespace detail
55 } // namespace clfft
56 } // namespace jb
57 
58 #endif // jb_clfft_complex_traits_hpp
STL namespace.
Generic version, not implemented.
The top-level namespace for the JayBeams library.
Definition: as_hhmmss.hpp:7