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
3502b44e
Commit
3502b44e
authored
Nov 30, 2022
by
Po-Yen, Chen
Browse files
Use ADL to find stream operator
parent
236bd148
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
include/ck/host_utility/io.hpp
include/ck/host_utility/io.hpp
+6
-4
No files found.
include/ck/host_utility/io.hpp
View file @
3502b44e
...
@@ -24,18 +24,20 @@ std::ostream& operator<<(std::ostream& os, const std::array<T, N>& v)
...
@@ -24,18 +24,20 @@ std::ostream& operator<<(std::ostream& os, const std::array<T, N>& v)
return
os
;
return
os
;
}
}
namespace
ck
{
template
<
typename
...
Ts
>
template
<
typename
...
Ts
>
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
ck
::
TensorDescriptor
<
Ts
...
>&
desc
)
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
TensorDescriptor
<
Ts
...
>&
desc
)
{
{
constexpr
ck
::
index_t
nDim
=
ck
::
remove_cvref_t
<
decltype
(
desc
)
>::
GetNumOfDimension
();
constexpr
index_t
nDim
=
remove_cvref_t
<
decltype
(
desc
)
>::
GetNumOfDimension
();
os
<<
"{"
;
os
<<
"{"
;
ck
::
static_for
<
0
,
nDim
-
1
,
1
>
{}([
&
](
auto
i
)
{
os
<<
desc
.
GetLength
(
i
)
<<
", "
;
});
static_for
<
0
,
nDim
-
1
,
1
>
{}([
&
](
auto
i
)
{
os
<<
desc
.
GetLength
(
i
)
<<
", "
;
});
os
<<
desc
.
GetLength
(
ck
::
Number
<
nDim
-
1
>
{});
os
<<
desc
.
GetLength
(
Number
<
nDim
-
1
>
{});
os
<<
"}"
;
os
<<
"}"
;
return
os
;
return
os
;
}
}
}
// namespace ck
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