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

Formatting

parent a4bf3a98
......@@ -14,21 +14,21 @@ namespace migraph {
using half = half_float::half;
namespace detail {
template<class T>
namespace detail {
template <class T>
struct deduce
{
using type = T;
};
template<>
template <>
struct deduce<half_float::detail::expr>
{
using type = half;
};
} // namespace detail
template<class T>
template <class T>
using deduce = typename detail::deduce<T>::type;
} // namespace migraph
......
......@@ -20,7 +20,7 @@ struct literal : raw_data<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>{})
{
static_assert(std::is_trivially_copyable<T>{}, "Literals can only be trivial types");
......
......@@ -14,14 +14,15 @@
namespace migraph {
#define MIGRAPH_DETAIL_EXTEND_TRAIT_FOR(trait, T) \
template<class X> \
struct trait : std::trait<X> \
{}; \
\
template<> \
struct trait<T> \
: std::true_type \
{};
template <class X> \
struct trait : std::trait<X> \
{ \
}; \
\
template <> \
struct trait<T> : std::true_type \
{ \
};
MIGRAPH_DETAIL_EXTEND_TRAIT_FOR(is_floating_point, 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