Skip to content

Commit ce79ded

Browse files
committed
fix(ggml-sycl): add synchronization before exiting argsort kernel
- Add `stream->wait()` to ensure all kernels finish execution before proceeding - This resolves potential race conditions in the argsort operation
1 parent 74f52f7 commit ce79ded

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ggml/src/ggml-sycl/ggml-sycl.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1774,7 +1774,9 @@ static void argsort_f32_i32_sycl(const float *x, int *dst, const int ncols,
17741774
} else {
17751775
GGML_ABORT("fatal error");
17761776
}
1777-
}
1777+
1778+
// Ensure all kernels finish execution before proceeding further
1779+
stream->wait();
17781780

17791781
static void argmax_f32_i32_sycl(const float *x, int *dst, const int ncols,
17801782
const int nrows, queue_ptr stream) {

0 commit comments

Comments
 (0)