diff --git a/onnxruntime/core/framework/plugin_data_transfer.cc b/onnxruntime/core/framework/plugin_data_transfer.cc index f753f00206c5d..d6b1680176815 100644 --- a/onnxruntime/core/framework/plugin_data_transfer.cc +++ b/onnxruntime/core/framework/plugin_data_transfer.cc @@ -41,7 +41,7 @@ Status DataTransfer::CopyTensors(const std::vector& src_dst_pairs) c for (size_t i = 0; i < src_dst_pairs.size(); ++i) { src_values.push_back(&values[i * 2]); dst_values.push_back(&values[i * 2 + 1]); - streams.push_back(nullptr); // static_cast(src_dst_pairs[i].src_stream)); + streams.push_back(reinterpret_cast(src_dst_pairs[i].src_stream)); } auto* status = impl_.CopyTensors(&impl_, src_values.data(), dst_values.data(), streams.data(), diff --git a/onnxruntime/core/providers/cuda/cuda_provider_factory.cc b/onnxruntime/core/providers/cuda/cuda_provider_factory.cc index 51a8b13cd8261..3b361f155831b 100644 --- a/onnxruntime/core/providers/cuda/cuda_provider_factory.cc +++ b/onnxruntime/core/providers/cuda/cuda_provider_factory.cc @@ -586,7 +586,7 @@ struct CudaSyncNotificationImpl : OrtSyncNotificationImpl { Release = ReleaseImpl; } - cudaStream_t& stream_; + cudaStream_t stream_; cudaEvent_t event_; const OrtApi& ort_api; @@ -632,9 +632,9 @@ struct CudaSyncStreamImpl : OrtSyncStreamImpl { *notification_impl = nullptr; std::unique_ptr notification; - cudaStream_t* cuda_stream = static_cast(impl.stream_.GetHandle()); + cudaStream_t cuda_stream = static_cast(impl.stream_.GetHandle()); - RETURN_IF_ERROR(CudaSyncNotificationImpl::Create(*cuda_stream, impl.ort_api, notification)); + RETURN_IF_ERROR(CudaSyncNotificationImpl::Create(cuda_stream, impl.ort_api, notification)); *notification_impl = notification.release(); return nullptr; diff --git a/onnxruntime/core/providers/nv_tensorrt_rtx/nv_provider_factory.cc b/onnxruntime/core/providers/nv_tensorrt_rtx/nv_provider_factory.cc index d23d50549b2c5..c3fbccef84883 100644 --- a/onnxruntime/core/providers/nv_tensorrt_rtx/nv_provider_factory.cc +++ b/onnxruntime/core/providers/nv_tensorrt_rtx/nv_provider_factory.cc @@ -431,7 +431,7 @@ struct NvTrtRtxSyncNotificationImpl : OrtSyncNotificationImpl { Release = ReleaseImpl; } - cudaStream_t& stream_; + cudaStream_t stream_; cudaEvent_t event_; const OrtApi& ort_api; @@ -477,9 +477,9 @@ struct NvTrtRtxSyncStreamImpl : OrtSyncStreamImpl { *notification_impl = nullptr; std::unique_ptr notification; - cudaStream_t* cuda_stream = static_cast(impl.stream_.GetHandle()); + cudaStream_t cuda_stream = static_cast(impl.stream_.GetHandle()); - RETURN_IF_ERROR(NvTrtRtxSyncNotificationImpl::Create(*cuda_stream, impl.ort_api, notification)); + RETURN_IF_ERROR(NvTrtRtxSyncNotificationImpl::Create(cuda_stream, impl.ort_api, notification)); *notification_impl = notification.release(); return nullptr;