Commit 73e64f33 authored by Paul's avatar Paul
Browse files

Formatting

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