Commit 34b44662 authored by Paul's avatar Paul
Browse files

Formatting

parent a4bf3a98
...@@ -15,20 +15,20 @@ namespace migraph { ...@@ -15,20 +15,20 @@ namespace migraph {
using half = half_float::half; using half = half_float::half;
namespace detail { namespace detail {
template<class T> template <class T>
struct deduce struct deduce
{ {
using type = T; using type = T;
}; };
template<> template <>
struct deduce<half_float::detail::expr> struct deduce<half_float::detail::expr>
{ {
using type = half; using type = half;
}; };
} // namespace detail } // namespace detail
template<class T> template <class T>
using deduce = typename detail::deduce<T>::type; using deduce = typename detail::deduce<T>::type;
} // namespace migraph } // namespace migraph
......
...@@ -20,7 +20,7 @@ struct literal : raw_data<literal> ...@@ -20,7 +20,7 @@ struct literal : raw_data<literal>
{ {
literal() {} literal() {}
template <class U, class T=deduce<U>> template <class U, class T = deduce<U>>
literal(U x) : buffer(make_shared_array<char>(sizeof(T))), m_shape(shape::get_type<T>{}) literal(U x) : buffer(make_shared_array<char>(sizeof(T))), m_shape(shape::get_type<T>{})
{ {
static_assert(std::is_trivially_copyable<T>{}, "Literals can only be trivial types"); static_assert(std::is_trivially_copyable<T>{}, "Literals can only be trivial types");
......
...@@ -14,14 +14,15 @@ ...@@ -14,14 +14,15 @@
namespace migraph { namespace migraph {
#define MIGRAPH_DETAIL_EXTEND_TRAIT_FOR(trait, T) \ #define MIGRAPH_DETAIL_EXTEND_TRAIT_FOR(trait, T) \
template<class X> \ template <class X> \
struct trait : std::trait<X> \ struct trait : std::trait<X> \
{}; \ { \
}; \
\ \
template<> \ template <> \
struct trait<T> \ struct trait<T> : std::true_type \
: std::true_type \ { \
{}; };
MIGRAPH_DETAIL_EXTEND_TRAIT_FOR(is_floating_point, half) MIGRAPH_DETAIL_EXTEND_TRAIT_FOR(is_floating_point, half)
MIGRAPH_DETAIL_EXTEND_TRAIT_FOR(is_signed, half) MIGRAPH_DETAIL_EXTEND_TRAIT_FOR(is_signed, half)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment