mgcpp
A C++ Math Library Based on CUDA
host_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_HOST_VALUE_TYPE_HPP_
8 #define _MGCPP_TYPE_TRAITS_HOST_VALUE_TYPE_HPP_
9 
10 #include <mgcpp/global/complex.hpp>
12 
13 #include <complex>
14 
15 namespace mgcpp {
16 template <typename Type>
17 struct value_type {
18  using type = Type;
19 };
20 
21 template <typename Type>
22 struct value_type<complex<Type>> {
23  using type = std::complex<Type>;
24 };
25 
26 #ifdef USE_HALF
27 template <>
28 struct value_type<mgcpp::half> {
29  using type = float;
30 };
31 #endif
32 
33 } // namespace mgcpp
34 
35 #endif
Definition: adapter_base.hpp:12
std::complex< Type > complex
Definition: complex.hpp:15
std::complex< Type > type
Definition: host_value_type.hpp:23
Definition: host_value_type.hpp:17
Type type
Definition: host_value_type.hpp:18