Skip to content

Commit 4464dfd

Browse files
committed
fix bounds
1 parent 8a42373 commit 4464dfd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

accelerated_scan/warp.cuh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,8 @@ __global__ void scan_grad(
391391
const weight_t kEmptyToken = 0.0;
392392

393393
// Limits for loading shifted tuples.
394-
const int minIdx = blockDim.x * kNChunksPerSequence * blockIdx.x;
395-
const int maxIdx = blockDim.x * kNChunksPerSequence * (blockIdx.x + 1);
394+
const int minIdx = seqoffset / Tuple::Size;
395+
const int maxIdx = minIdx + blockDim.x * kNChunksPerSequence;
396396

397397
for (int chunk = 0; chunk < kNChunksPerSequence; chunk++) {
398398
const int offset = seqoffset + (kNChunksPerSequence - 1 - chunk) * chunklen;

0 commit comments

Comments
 (0)