From ab95aec21371ce16943686439597f6b02fa29eaa Mon Sep 17 00:00:00 2001 From: Lee Killough Date: Sat, 26 Sep 2020 10:17:42 -0700 Subject: [PATCH] Do not synchronize when unnecessary --- library/src/rocblas_auxiliary.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/src/rocblas_auxiliary.cpp b/library/src/rocblas_auxiliary.cpp index fbc78281a..49cb3696e 100644 --- a/library/src/rocblas_auxiliary.cpp +++ b/library/src/rocblas_auxiliary.cpp @@ -159,6 +159,8 @@ try return rocblas_status_invalid_handle; if(handle->layer_mode & rocblas_layer_mode_log_trace) log_trace(handle, "rocblas_set_stream", stream_id); + if(stream_id == handle->rocblas_stream) + return rocblas_status_success; RETURN_IF_HIP_ERROR(hipStreamSynchronize(handle->rocblas_stream)); handle->rocblas_stream = stream_id; return rocblas_status_success;