Skip to content

Commit 9334357

Browse files
committed
Review: early exit if col!=0
1 parent 866cdfe commit 9334357

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ggml/src/ggml-cuda/common.cuh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,11 @@ static __global__ void reduce_rows_f32(const float * x, float * dst, const int n
375375

376376
sum = warp_reduce_sum(sum);
377377

378-
if (col == 0) {
379-
dst[row] = norm ? sum / ncols : sum;
378+
if (col != 0) {
379+
return;
380380
}
381+
382+
dst[row] = norm ? sum / ncols : sum;
381383
}
382384

383385
template<int width = WARP_SIZE>

0 commit comments

Comments
 (0)