aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCebtenzzre <cebtenzzre@gmail.com>2023-08-04 11:34:32 -0400
committerGitHub <noreply@github.com>2023-08-04 17:34:32 +0200
commit02f9d96a866268700b8d8e7acbbcb4392c5ff345 (patch)
treee5af5fd83ee764ae3554b36645cd69de1c661775
parent3498588e0fb4daf040c4e3c698595cb0bfd345c0 (diff)
CUDA: check if event is NULL before cudaStreamWaitEvent (#2505)
Fixes #2503
-rw-r--r--ggml-cuda.cu2
1 files changed, 1 insertions, 1 deletions
diff --git a/ggml-cuda.cu b/ggml-cuda.cu
index e0192bc..4321e46 100644
--- a/ggml-cuda.cu
+++ b/ggml-cuda.cu
@@ -5203,7 +5203,7 @@ static void ggml_cuda_op(const ggml_tensor * src0, const ggml_tensor * src1, ggm
if (split && g_device_count > 1) {
CUDA_CHECK(cudaSetDevice(g_main_device));
for (int id = 0; id < g_device_count; ++id) {
- if (id != g_main_device) {
+ if (id != g_main_device && src0_extra->events[id]) {
CUDA_CHECK(cudaStreamWaitEvent(g_cudaStreams_main[g_main_device], src0_extra->events[id]));
}
}