Skip to content

Commit 1107531

Browse files
committed
Fix one more typo
1 parent 31c4d41 commit 1107531

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

algorithms/cudahip/Reduction.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ void __global__ kernel_reduce(AccT* result, const VecT* vector, size_t size, boo
7777
const auto lastWarpsNeeded = (warpCount + warpSize - 1) / warpSize;
7878
auto lastAcc = operation.defaultValue;
7979
#pragma unroll 2
80-
for (int i = 0; i < lastWarpsNeeded; i += warpSize) {
81-
const auto id = threadInWarp + i;
80+
for (int i = 0; i < lastWarpsNeeded; ++i) {
81+
const auto id = threadInWarp + i * warpSize;
8282
auto value = (id < warpCount) ? shmem[id] : operation.defaultValue;
8383

8484
for (int offset = 1; offset < warpSize; offset *= 2) {

0 commit comments

Comments
 (0)