Commit ec31c597 authored by Paul's avatar Paul
Browse files

Fix tidy warnings

parent 46653e67
...@@ -223,8 +223,9 @@ auto visit_all(const std::vector<T>& x) ...@@ -223,8 +223,9 @@ auto visit_all(const std::vector<T>& x)
s.visit_type([&](auto as) { s.visit_type([&](auto as) {
using type = typename decltype(as)::type; using type = typename decltype(as)::type;
std::vector<tensor_view<type>> result; std::vector<tensor_view<type>> result;
for(const auto& y : x) std::transform(x.begin(), x.end(), std::back_inserter(result), [&](const auto& y) {
result.push_back(make_view(y.get_shape(), as.from(y.data()))); return make_view(y.get_shape(), as.from(y.data()));
});
v(result); v(result);
}); });
}; };
......
...@@ -70,12 +70,10 @@ void nary_broadcast_vec_impl( ...@@ -70,12 +70,10 @@ void nary_broadcast_vec_impl(
auto bidx = ((i * vec_size) % bdim_next_stride) / bdim_stride; auto bidx = ((i * vec_size) % bdim_next_stride) / bdim_stride;
auto b = bp[bidx]; auto b = bp[bidx];
auto out = output.data()[i]; auto out = output.data()[i];
pack(inputs.data()[i]...)([&](auto... xs) __device__ { for(std::size_t j = 0; j < vec_size; j++)
for(std::size_t j = 0; j < vec_size; j++) {
{ out[j] = f(inputs.data()[i][j]..., b);
out[j] = f(xs[j]..., b); }
}
});
output.data()[i] = out; output.data()[i] = out;
} }
}); });
......
...@@ -18,7 +18,7 @@ inline namespace MIGRAPHX_INLINE_NS { ...@@ -18,7 +18,7 @@ inline namespace MIGRAPHX_INLINE_NS {
namespace gpu { namespace gpu {
namespace device { namespace device {
#define MIGRAPHX_DEVICE_CONSTEXPR constexpr __device__ __host__ #define MIGRAPHX_DEVICE_CONSTEXPR constexpr __device__ __host__ // NOLINT
template <class T, std::size_t N> template <class T, std::size_t N>
using vec = T __attribute__((ext_vector_type(N))); using vec = T __attribute__((ext_vector_type(N)));
......
...@@ -24,7 +24,7 @@ struct hip_vector ...@@ -24,7 +24,7 @@ struct hip_vector
__device__ __host__ hip_vector(std::initializer_list<T> x) __device__ __host__ hip_vector(std::initializer_list<T> x)
{ {
auto it = std::copy(x.begin(), x.end(), d); std::copy(x.begin(), x.end(), d);
len = x.size(); len = x.size();
} }
......
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