Skip to content

Commit

Permalink
Fixes stride_reduce() for std::vector.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathonl committed Feb 3, 2021
1 parent 39a4862 commit 71e8918
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/savvy/utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ namespace savvy

for (std::size_t i = 0; i < sz; )
{
const std::size_t local_end = i + stride;
auto dest_idx = i / stride;
vec[dest_idx] = vec[i++];

const std::size_t local_end = i + stride;
for ( ; i < local_end; ++i)
{
vec[dest_idx] += vec[i];
Expand Down

0 comments on commit 71e8918

Please sign in to comment.