"src/git@developer.sourcefind.cn:gaoqiong/migraphx.git" did not exist on "f201285c8cd08a1140090be6bd3bffcb0746775f"
Commit b3935928 authored by Paul's avatar Paul
Browse files

Formatting

parent 506a73ec
...@@ -77,11 +77,11 @@ struct hip_shape ...@@ -77,11 +77,11 @@ struct hip_shape
MIGRAPHX_DEVICE_CONSTEXPR hip_index carry(hip_index result) const MIGRAPHX_DEVICE_CONSTEXPR hip_index carry(hip_index result) const
{ {
std::ptrdiff_t rem = 0; std::ptrdiff_t rem = 0;
for(std::ptrdiff_t i = result.size()-1; i >= 0; i--) for(std::ptrdiff_t i = result.size() - 1; i >= 0; i--)
{ {
auto z = result[i] + rem; auto z = result[i] + rem;
rem = z - std::ptrdiff_t(lens[i]) + 1; rem = z - std::ptrdiff_t(lens[i]) + 1;
if (rem > 0) if(rem > 0)
z -= rem; z -= rem;
else else
rem = 0; rem = 0;
......
...@@ -70,7 +70,7 @@ void reduce_sum(hipStream_t stream, const argument& result, const argument& arg) ...@@ -70,7 +70,7 @@ void reduce_sum(hipStream_t stream, const argument& result, const argument& arg)
const std::size_t block_size = compute_block_size(relements, max_block_size); const std::size_t block_size = compute_block_size(relements, max_block_size);
gs_launch(stream, nelements * block_size, block_size)([=](auto i, auto idx) __device__ { gs_launch(stream, nelements * block_size, block_size)([=](auto i, auto idx) __device__ {
const auto out_idx = i / block_size; const auto out_idx = i / block_size;
auto base_idx = output.get_shape().multi(out_idx); auto base_idx = output.get_shape().multi(out_idx);
auto r = block_reduce<max_block_size>(idx, sum{}, 0, relements, [&](auto j) __device__ { auto r = block_reduce<max_block_size>(idx, sum{}, 0, relements, [&](auto j) __device__ {
auto reduce_idx = reduce_shape.multi(j); auto reduce_idx = reduce_shape.multi(j);
return input[reduce_idx + base_idx]; return input[reduce_idx + base_idx];
......
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