half.hpp 899 Bytes
Newer Older
Paul's avatar
Paul committed
1
2
3
4
5
6
7
8
9
10
11
/*=============================================================================
    Copyright (c) 2017 Paul Fultz II
    half.hpp
    Distributed under the Boost Software License, Version 1.0. (See accompanying
    file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/

#ifndef MIGRAPH_GUARD_RTGLIB_HALF_HPP
#define MIGRAPH_GUARD_RTGLIB_HALF_HPP

#include <half.hpp>
12
#include <migraph/config.hpp>
Paul's avatar
Paul committed
13

14
15
namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
Paul's avatar
Paul committed
16
17
18

using half = half_float::half;

Paul's avatar
Paul committed
19
20
namespace detail {
template <class T>
Paul's avatar
Paul committed
21
22
23
24
25
struct deduce
{
    using type = T;
};

Paul's avatar
Paul committed
26
template <>
Paul's avatar
Paul committed
27
28
29
30
31
32
struct deduce<half_float::detail::expr>
{
    using type = half;
};
} // namespace detail

Paul's avatar
Paul committed
33
template <class T>
Paul's avatar
Paul committed
34
35
using deduce = typename detail::deduce<T>::type;

36
} // namespace MIGRAPH_INLINE_NS
Paul's avatar
Paul committed
37
38
39
} // namespace migraph

#endif