"vscode:/vscode.git/clone" did not exist on "f8ae600ce4b3e728e7e852908603a225f2fe5932"
Commit 73e64f33 authored by Paul's avatar Paul
Browse files

Formatting

parent 01543cc4
...@@ -39,36 +39,33 @@ auto reflectable_impl(rank<1>, T&& x) ...@@ -39,36 +39,33 @@ auto reflectable_impl(rank<1>, T&& x)
template <class T> template <class T>
auto reflectable_impl(rank<0>, T &&) -> decltype(std::false_type{}); auto reflectable_impl(rank<0>, T &&) -> decltype(std::false_type{});
template<class T> template <class T>
struct remove_rvalue_reference struct remove_rvalue_reference
{ {
using type = T; using type = T;
}; };
template<class T> template <class T>
struct remove_rvalue_reference<T&&> struct remove_rvalue_reference<T&&>
{ {
using type = T; using type = T;
}; };
template<class T> template <class T>
struct wrapper struct wrapper
{ {
using type = typename remove_rvalue_reference<T>::type; using type = typename remove_rvalue_reference<T>::type;
type data; type data;
type get() const type get() const { return data; }
{
return data;
}
}; };
template<class T> template <class T>
wrapper<T> wrap(std::remove_reference_t<T>& x) wrapper<T> wrap(std::remove_reference_t<T>& x)
{ {
return wrapper<T>{std::forward<T>(x)}; return wrapper<T>{std::forward<T>(x)};
} }
template< class... Ts > template <class... Ts>
std::tuple<typename remove_rvalue_reference<Ts>::type...> auto_tuple(Ts&&... xs) std::tuple<typename remove_rvalue_reference<Ts>::type...> auto_tuple(Ts&&... xs)
{ {
return {std::forward<Ts>(xs)...}; return {std::forward<Ts>(xs)...};
...@@ -95,10 +92,11 @@ auto reflect_tie(T& x) ...@@ -95,10 +92,11 @@ auto reflect_tie(T& x)
template <class T, class F> template <class T, class F>
void reflect_each(T& x, F f) void reflect_each(T& x, F f)
{ {
return reflect(x, [](auto&& y, auto... ys) { return pack(detail::wrap<decltype(y)>(y), ys...); })( return reflect(x, [](auto&& y, auto... ys) {
[&](auto&&... xs) { return pack(detail::wrap<decltype(y)>(y), ys...);
each_args([&](auto p) { p([&](auto&& y, auto... ys) { f(y.get(), ys...); }); }, xs...); })([&](auto&&... xs) {
}); each_args([&](auto p) { p([&](auto&& y, auto... ys) { f(y.get(), ys...); }); }, xs...);
});
} }
} // namespace MIGRAPHX_INLINE_NS } // namespace MIGRAPHX_INLINE_NS
......
...@@ -171,7 +171,10 @@ auto reflect(miopenActivationDescriptor_t ad, F f) ...@@ -171,7 +171,10 @@ auto reflect(miopenActivationDescriptor_t ad, F f)
double beta = 0.0; double beta = 0.0;
double gamma = 0.0; double gamma = 0.0;
miopenGetActivationDescriptor(ad, &mode, &alpha, &beta, &gamma); miopenGetActivationDescriptor(ad, &mode, &alpha, &beta, &gamma);
return pack(f(std::move(mode), "mode"), f(std::move(alpha), "alpha"), f(std::move(beta), "beta"), f(std::move(gamma), "gamma")); return pack(f(std::move(mode), "mode"),
f(std::move(alpha), "alpha"),
f(std::move(beta), "beta"),
f(std::move(gamma), "gamma"));
} }
template <class F> template <class F>
...@@ -184,7 +187,11 @@ auto reflect(miopenLRNDescriptor_t lrnd, F f) ...@@ -184,7 +187,11 @@ auto reflect(miopenLRNDescriptor_t lrnd, F f)
double beta = 0.0; double beta = 0.0;
double k = 0.0; double k = 0.0;
miopenGetLRNDescriptor(lrnd, &mode, &n, &alpha, &beta, &k); miopenGetLRNDescriptor(lrnd, &mode, &n, &alpha, &beta, &k);
return pack(f(std::move(mode), "mode"), f(std::move(n), "n"), f(std::move(alpha), "alpha"), f(std::move(beta), "beta"), f(std::move(k), "k")); return pack(f(std::move(mode), "mode"),
f(std::move(n), "n"),
f(std::move(alpha), "alpha"),
f(std::move(beta), "beta"),
f(std::move(k), "k"));
} }
} // namespace gpu } // namespace gpu
......
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