From 20afe825274f60e3a529f248ae4f81d52b3db615 Mon Sep 17 00:00:00 2001 From: Sudhanshu Gupta Date: Thu, 6 Apr 2023 12:22:22 -0400 Subject: [PATCH] Fix cudaStreamSynchronize --- libcuda/cuda_runtime_api.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libcuda/cuda_runtime_api.cc b/libcuda/cuda_runtime_api.cc index fd05f555c..eba7b9d73 100644 --- a/libcuda/cuda_runtime_api.cc +++ b/libcuda/cuda_runtime_api.cc @@ -2038,9 +2038,11 @@ __host__ cudaError_t CUDARTAPI cudaStreamSynchronizeInternal( announce_call(__my_func__); } #if (CUDART_VERSION >= 3000) - if (stream == NULL) ctx->synchronize(); - return g_last_cudaError = cudaSuccess; - stream->synchronize(); + if (stream == NULL) { + ctx->synchronize(); + } else { + stream->synchronize(); + } #else printf( "GPGPU-Sim PTX: WARNING: Asynchronous kernel execution not supported "