mgcpp
A C++ Math Library Based on CUDA
device_value_type.hpp
Go to the documentation of this file.
1 
2 // Copyright RedPortal, mujjingun 2017 - 2018.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6 
7 #ifndef _MGCPP_TYPE_TRAITS_DEVICE_VALUE_TYPE_HPP_
8 #define _MGCPP_TYPE_TRAITS_DEVICE_VALUE_TYPE_HPP_
9 
10 #include <cuComplex.h>
11 #include <cuda_fp16.h>
12 #include <mgcpp/global/complex.hpp>
14 
15 #include <complex>
16 
17 namespace mgcpp {
18 template <typename Type>
20  using type = Type;
21 };
22 
23 template <>
24 struct device_value_type<complex<float>> {
25  using type = cuComplex;
26 };
27 
28 template <>
29 struct device_value_type<complex<double>> {
30  using type = cuDoubleComplex;
31 };
32 
33 template <>
34 struct device_value_type<half> {
35  using type = __half;
36 };
37 } // namespace mgcpp
38 
39 #endif
Definition: adapter_base.hpp:12
__half type
Definition: device_value_type.hpp:35
Definition: device_value_type.hpp:19
std::complex< Type > complex
Definition: complex.hpp:15
cuDoubleComplex type
Definition: device_value_type.hpp:30
cuComplex type
Definition: device_value_type.hpp:25
Type type
Definition: device_value_type.hpp:20