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
a7dcd9fb
Commit
a7dcd9fb
authored
Jun 29, 2018
by
Paul
Browse files
Formatting
parent
aaf4fcc6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
11 deletions
+13
-11
src/include/rtg/raw_data.hpp
src/include/rtg/raw_data.hpp
+9
-9
src/include/rtg/requires.hpp
src/include/rtg/requires.hpp
+4
-2
No files found.
src/include/rtg/raw_data.hpp
View file @
a7dcd9fb
...
@@ -90,19 +90,19 @@ struct raw_data : raw_data_base
...
@@ -90,19 +90,19 @@ struct raw_data : raw_data_base
return
self
->
template
at
<
T
>();
return
self
->
template
at
<
T
>();
}
}
template
<
class
T
>
template
<
class
T
>
using
is_data_ptr
=
bool_c
<
(
std
::
is_void
<
T
>
{}
or
std
::
is_same
<
char
,
std
::
remove_cv_t
<
T
>>
{}
or
std
::
is_same
<
unsigned
char
,
std
::
remove_cv_t
<
T
>>
{})
>
;
using
is_data_ptr
=
bool_c
<
(
std
::
is_void
<
T
>
{}
or
std
::
is_same
<
char
,
std
::
remove_cv_t
<
T
>>
{}
or
std
::
is_same
<
unsigned
char
,
std
::
remove_cv_t
<
T
>>
{})
>
;
template
<
class
T
>
template
<
class
T
>
using
get_data_type
=
std
::
conditional_t
<
is_data_ptr
<
T
>
{},
using
get_data_type
=
std
::
conditional_t
<
is_data_ptr
<
T
>
{},
float
,
T
>
;
float
,
T
>
;
template
<
class
T
>
template
<
class
T
>
bool
matches
()
const
bool
matches
()
const
{
{
return
is_data_ptr
<
T
>
{}
||
self
->
get_shape
().
type
()
==
rtg
::
shape
::
get_type
<
get_data_type
<
T
>>
{};
return
is_data_ptr
<
T
>
{}
||
self
->
get_shape
().
type
()
==
rtg
::
shape
::
get_type
<
get_data_type
<
T
>>
{};
}
}
template
<
class
T
>
template
<
class
T
>
...
...
src/include/rtg/requires.hpp
View file @
a7dcd9fb
...
@@ -10,13 +10,15 @@ struct and_ : std::is_same<and_<Bs...>, and_<(Bs || true)...>> // NOLINT
...
@@ -10,13 +10,15 @@ struct and_ : std::is_same<and_<Bs...>, and_<(Bs || true)...>> // NOLINT
{
{
};
};
template
<
bool
B
>
template
<
bool
B
>
using
bool_c
=
std
::
integral_constant
<
bool
,
B
>
;
using
bool_c
=
std
::
integral_constant
<
bool
,
B
>
;
#ifdef CPPCHECK
#ifdef CPPCHECK
#define RTG_REQUIRES(...) class = void
#define RTG_REQUIRES(...) class = void
#else
#else
#define RTG_REQUIRES(...) bool PrivateRequires ## __LINE__ = true, class = typename std::enable_if<and_<__VA_ARGS__, PrivateRequires ## __LINE__>{}>::type
#define RTG_REQUIRES(...) \
bool PrivateRequires##__LINE__ = true, \
class = typename std::enable_if<and_<__VA_ARGS__, PrivateRequires##__LINE__>{}>::type
#endif
#endif
}
// namespace rtg
}
// namespace rtg
...
...
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