Commit 318dbc15 authored by Shucai Xiao's avatar Shucai Xiao
Browse files

clang format

parent 5e951d3b
...@@ -516,9 +516,7 @@ capture_arguments(program& prog, const target& t, const std::vector<std::string> ...@@ -516,9 +516,7 @@ capture_arguments(program& prog, const target& t, const std::vector<std::string>
// consider shift, so set shift to 0 // consider shift, so set shift to 0
std::vector<float> vec_val; std::vector<float> vec_val;
auto&& arg = t.copy_from(args.front()); auto&& arg = t.copy_from(args.front());
arg.visit([&](auto output) { arg.visit([&](auto output) { vec_val.assign(output.begin(), output.end()); });
vec_val.assign(output.begin(), output.end());
});
auto max_val = *std::max_element(vec_val.begin(), vec_val.end()); auto max_val = *std::max_element(vec_val.begin(), vec_val.end());
auto min_val = *std::min_element(vec_val.begin(), vec_val.end()); auto min_val = *std::min_element(vec_val.begin(), vec_val.end());
auto max_abs = std::max(std::fabs(max_val), std::fabs(min_val)); auto max_abs = std::max(std::fabs(max_val), std::fabs(min_val));
......
...@@ -57,14 +57,12 @@ struct target ...@@ -57,14 +57,12 @@ struct target
* @return Allocated argument in the target. * @return Allocated argument in the target.
*/ */
argument allocate(const shape& s) const; argument allocate(const shape& s) const;
}; };
#else #else
template <class T> template <class T>
auto target_allocate(rank<1>, T& x, const shape& s) auto target_allocate(rank<1>, T& x, const shape& s) -> decltype(x.allocate(s))
-> decltype(x.allocate(s))
{ {
return x.allocate(s); return x.allocate(s);
} }
...@@ -84,8 +82,7 @@ argument target_allocate(T& x, const shape& s) ...@@ -84,8 +82,7 @@ argument target_allocate(T& x, const shape& s)
} }
template <class T> template <class T>
auto copy_to_target(rank<1>, T& x, const argument& arg) auto copy_to_target(rank<1>, T& x, const argument& arg) -> decltype(x.copy_to(arg))
-> decltype(x.copy_to(arg))
{ {
return x.copy_to(arg); return x.copy_to(arg);
} }
...@@ -106,9 +103,7 @@ argument copy_to_target(T& x, const argument& arg) ...@@ -106,9 +103,7 @@ argument copy_to_target(T& x, const argument& arg)
} }
template <class T> template <class T>
auto copy_from_target( auto copy_from_target(rank<1>, T& x, const argument& arg) -> decltype(x.copy_from(arg))
rank<1>, T& x, const argument& arg)
-> decltype(x.copy_from(arg))
{ {
return x.copy_from(arg); return x.copy_from(arg);
} }
......
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