"...composable_kernel_rocm.git" did not exist on "294cb823142a815170cf1faa63e01a431a557a04"
Commit a39bf375 authored by Paul's avatar Paul
Browse files

Add a default print using reflect

parent 6c375c50
...@@ -54,7 +54,16 @@ namespace operation_stream { ...@@ -54,7 +54,16 @@ namespace operation_stream {
template <class T> template <class T>
auto operator<<(std::ostream& os, const T& x) -> decltype(os << x.name()) auto operator<<(std::ostream& os, const T& x) -> decltype(os << x.name())
{ {
return os << x.name(); os << x.name();
char delim = '[';
reflect_each(x, [&](auto& y, auto name, auto&&...) {
os << delim;
os << name << "=" << y;
delim = ',';
});
if(delim == ',')
os << "]";
return os;
} }
} // namespace operation_stream } // namespace operation_stream
......
...@@ -54,7 +54,15 @@ namespace operation_stream { ...@@ -54,7 +54,15 @@ namespace operation_stream {
template <class T> template <class T>
auto operator<<(std::ostream& os, const T& x) -> decltype(os << x.name()) auto operator<<(std::ostream& os, const T& x) -> decltype(os << x.name())
{ {
return os << x.name(); os << x.name();
char delim = '[';
reflect_each(x, [&](auto& y, auto name, auto&&...) {
os << delim;
os << name << "=" << y;
delim = ',';
});
if(delim == ',') os << "]";
return os;
} }
} // namespace operation_stream } // namespace operation_stream
......
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