This commit is contained in:
Iwan Kawrakow
2025-08-15 08:32:35 +03:00
parent 54084f28c0
commit 6873fbcbdf

View File

@@ -457,6 +457,10 @@ ggml_backend_cuda_context::ggml_backend_cuda_context(int device) :
}
ggml_backend_cuda_context::~ggml_backend_cuda_context() {
std::unique_lock<std::mutex> lock(ggml_cuda_lock);
ggml_cuda_lock_cv.wait(lock, []{ return ggml_cuda_lock_counter.load(std::memory_order_relaxed) == 0; });
if (copy_event != nullptr) {
CUDA_CHECK(cudaEventDestroy(copy_event));
}