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
composable_kernel
Commits
70757860
Commit
70757860
authored
Sep 06, 2022
by
Po-Yen, Chen
Browse files
Add simple type traits to validate device op type
parent
bc26a2fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
example/36_permute/common.hpp
example/36_permute/common.hpp
+29
-0
No files found.
example/36_permute/common.hpp
View file @
70757860
...
@@ -176,6 +176,35 @@ struct is_random_access_range<Range, std::void_t<>>
...
@@ -176,6 +176,35 @@ struct is_random_access_range<Range, std::void_t<>>
template
<
typename
Range
>
template
<
typename
Range
>
inline
constexpr
bool
is_random_access_range_v
=
is_random_access_range
<
Range
>::
value
;
inline
constexpr
bool
is_random_access_range_v
=
is_random_access_range
<
Range
>::
value
;
template
<
typename
T
,
typename
=
void
>
struct
is_device_op
:
std
::
false_type
{
};
template
<
typename
T
>
struct
is_device_op
<
T
,
std
::
void_t
<
typename
T
::
Argument
,
typename
T
::
Invoker
,
decltype
(
T
::
IsSupportedArgument
(
std
::
declval
<
const
typename
T
::
Argument
&>
())),
decltype
(
T
::
MakeInvoker
()),
decltype
(
std
::
declval
<
T
&>
().
MakeInvokerPointer
())
>>
:
std
::
bool_constant
<
std
::
is_base_of_v
<
ck
::
tensor_operation
::
device
::
BaseOperator
,
T
>
&&
std
::
is_base_of_v
<
ck
::
tensor_operation
::
device
::
BaseArgument
,
typename
T
::
Argument
>
&&
std
::
is_base_of_v
<
ck
::
tensor_operation
::
device
::
BaseInvoker
,
typename
T
::
Invoker
>
&&
std
::
is_same_v
<
bool
,
decltype
(
T
::
IsSupportedArgument
(
std
::
declval
<
const
typename
T
::
Argument
&>
()))
>
&&
std
::
is_same_v
<
typename
T
::
Invoker
,
decltype
(
T
::
MakeInvoker
())
>
&&
std
::
is_same_v
<
std
::
unique_ptr
<
ck
::
tensor_operation
::
device
::
BaseInvoker
>
,
decltype
(
std
::
declval
<
T
&>
().
MakeInvokerPointer
())
>>
{
};
template
<
typename
T
>
inline
constexpr
bool
is_device_op_v
=
is_device_op
<
T
>::
value
;
}
// namespace detail
}
// namespace detail
template
<
typename
Axes
>
template
<
typename
Axes
>
...
...
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