From f328b6bfdbb13ad3884050275beee179daf2590a Mon Sep 17 00:00:00 2001 From: Yulong Wang <7679871+fs-eire@users.noreply.github.com> Date: Fri, 30 Aug 2024 16:37:17 -0700 Subject: [PATCH] fix build break --- .../core/providers/cuda/math/binary_elementwise_ops.cc | 6 +++--- .../core/providers/cuda/math/variadic_elementwise_ops.cc | 3 ++- onnxruntime/core/providers/utils.h | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/onnxruntime/core/providers/cuda/math/binary_elementwise_ops.cc b/onnxruntime/core/providers/cuda/math/binary_elementwise_ops.cc index 5e1961f99982e..452df0d4fa7c4 100644 --- a/onnxruntime/core/providers/cuda/math/binary_elementwise_ops.cc +++ b/onnxruntime/core/providers/cuda/math/binary_elementwise_ops.cc @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#include "core/providers/utils.h" - #include "core/providers/cuda/math/binary_elementwise_ops.h" #include "core/providers/cuda/math/binary_elementwise_ops_impl.h" #include "core/providers/cuda/math/unary_elementwise_ops_impl.h" +#include "core/providers/utils.h" + using namespace onnxruntime::common; namespace onnxruntime { namespace cuda { @@ -51,7 +51,7 @@ Status BinaryElementwise::Prepare(OpKernelContext* context, Bin const auto& rhs_shape = rhs_tensor->Shape(); TensorShape output_shape; - ORT_RETURN_IF_ERROR(utils::ComputeOutputShape(Node().Name(), lhs_shape, rhs_shape, output_shape)); + ORT_RETURN_IF_ERROR(utils::ComputeBroadcastOutputShape(Node().Name(), lhs_shape, rhs_shape, output_shape)); auto output_tensor = context->Output(0, output_shape); ORT_RETURN_IF_ERROR(BinaryElementwiseBroadcastPrepare(lhs_tensor, rhs_tensor, output_tensor, p)); diff --git a/onnxruntime/core/providers/cuda/math/variadic_elementwise_ops.cc b/onnxruntime/core/providers/cuda/math/variadic_elementwise_ops.cc index 69904edb8130b..05c8b0a322529 100644 --- a/onnxruntime/core/providers/cuda/math/variadic_elementwise_ops.cc +++ b/onnxruntime/core/providers/cuda/math/variadic_elementwise_ops.cc @@ -2,6 +2,7 @@ // Licensed under the MIT License. #include "core/providers/shared_library/provider_api.h" +#include "core/providers/utils.h" #include "core/providers/cuda/math/variadic_elementwise_ops.h" #include @@ -209,7 +210,7 @@ Status VariadicElementwiseOp TensorShape output_shape; TensorShape previous_output_shape = first_input_tensor.Shape(); for (int index = 1; index < input_count; index++) { - ORT_RETURN_IF_ERROR(ComputeOutputShape( + ORT_RETURN_IF_ERROR(utils::ComputeBroadcastOutputShape( node_name, previous_output_shape, input_tensors[index].get().Shape(), output_shape)); previous_output_shape = output_shape; } diff --git a/onnxruntime/core/providers/utils.h b/onnxruntime/core/providers/utils.h index 5c29369f36b22..0999616dfbea1 100644 --- a/onnxruntime/core/providers/utils.h +++ b/onnxruntime/core/providers/utils.h @@ -3,9 +3,11 @@ #pragma once +#ifndef SHARED_PROVIDER #include "core/framework/framework_common.h" #include "core/framework/op_kernel_context_internal.h" #include "core/providers/common.h" +#endif namespace onnxruntime { namespace utils {