Skip to content

Commit e808dfc

Browse files
committed
tweak form of 'reduce()'
1 parent aab9a7c commit e808dfc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

inst/include/RcppParallel/simd/map_reduce.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ U simdMapReduce(const T* it, const T* end, U init, MapReducer mapper)
3434
for (; it != aligned_end; it += N)
3535
mapper.map(boost::simd::aligned_load<vT>(it), &buffer);
3636

37-
// Reduce our buffer
38-
mapper.reduce(buffer, &init);
37+
// Reduce our buffer, and join it with the initial value
38+
mapper.map(mapper.reduce(buffer), &init);
3939

4040
// Leftover unaligned region
4141
for (; it != end; ++it)

0 commit comments

Comments
 (0)