Skip to content

Commit 3ceb97d

Browse files
committed
fix uninitialized counter when using 1 thread only
1 parent d4bdfc6 commit 3ceb97d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ggml/src/ggml-cpu/ggml-cpu.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7800,12 +7800,12 @@ static void ggml_compute_forward_mul_mat_id(
78007800
matrix_row_counts[i02] += 1;
78017801
}
78027802
}
7803-
} else {
7804-
// reset current_chunk
7805-
for (int cur_a = ith - 1; cur_a < n_as; cur_a += (nth - 1)) {
7806-
atomic_int * current_chunk_ctr = (atomic_int *)(atomic_current_chunk + cur_a);
7807-
*current_chunk_ctr = nth;
7808-
}
7803+
}
7804+
7805+
// reset current_chunk
7806+
for (int cur_a = ith; cur_a < n_as; cur_a += nth) {
7807+
atomic_int * current_chunk_ctr = (atomic_int *)(atomic_current_chunk + cur_a);
7808+
*current_chunk_ctr = nth;
78097809
}
78107810

78117811
ggml_barrier(params->threadpool);

0 commit comments

Comments
 (0)