From 44b7d26526f6465dacaf01a73d16ae13b57390b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20M=C3=BCller?= Date: Thu, 5 Oct 2023 00:49:05 +0200 Subject: [PATCH] adding pre pack sync --- onnxruntime/core/providers/cuda/nn/conv.cc | 1 + onnxruntime/core/providers/cuda/nn/conv_transpose.cc | 1 + 2 files changed, 2 insertions(+) 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; } }