diff --git a/onnxruntime/core/providers/cuda/nn/conv.cc b/onnxruntime/core/providers/cuda/nn/conv.cc index f1626da36562e..4ccb5a3baeecb 100644 --- a/onnxruntime/core/providers/cuda/nn/conv.cc +++ b/onnxruntime/core/providers/cuda/nn/conv.cc @@ -118,6 +118,7 @@ Status Conv::PrePack(const Tensor& tensor, int input_idx, AllocatorPtr if (!status.IsOK()) { return status; } + CUDA_CALL_THROW(cudaStreamSynchronize(DefaultCudaStream())); is_packed = true; } } diff --git a/onnxruntime/core/providers/cuda/nn/conv_transpose.cc b/onnxruntime/core/providers/cuda/nn/conv_transpose.cc index a1c15fe257649..a8831a09605b7 100644 --- a/onnxruntime/core/providers/cuda/nn/conv_transpose.cc +++ b/onnxruntime/core/providers/cuda/nn/conv_transpose.cc @@ -77,6 +77,7 @@ Status ConvTranspose::PrePack(const Tensor& tensor, int input_idx, Allo if (!status.IsOK()) { return status; } + CUDA_CALL_THROW(cudaStreamSynchronize(DefaultCudaStream())); is_packed = true; } }