Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
MIGraphX
Commits
34b44662
Commit
34b44662
authored
Oct 31, 2018
by
Paul
Browse files
Formatting
parent
a4bf3a98
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
13 deletions
+14
-13
src/include/migraph/half.hpp
src/include/migraph/half.hpp
+4
-4
src/include/migraph/literal.hpp
src/include/migraph/literal.hpp
+1
-1
src/include/migraph/type_traits.hpp
src/include/migraph/type_traits.hpp
+9
-8
No files found.
src/include/migraph/half.hpp
View file @
34b44662
...
@@ -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
...
...
src/include/migraph/literal.hpp
View file @
34b44662
...
@@ -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"
);
...
...
src/include/migraph/type_traits.hpp
View file @
34b44662
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment