Skip to content

Commit

Permalink
onnxruntime: patch needed for gcc 13.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
smuzaffar committed Jan 27, 2025
1 parent c3ad899 commit a3d98ce
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
26 changes: 26 additions & 0 deletions onnxruntime-gcc13.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/onnxruntime/core/optimizer/selectors_actions/selector_action_transformer.cc b/onnxruntime/core/optimizer/selectors_actions/selector_action_transformer.cc
index b68cbaf..b1d6c51 100644
--- a/onnxruntime/core/optimizer/selectors_actions/selector_action_transformer.cc
+++ b/onnxruntime/core/optimizer/selectors_actions/selector_action_transformer.cc
@@ -147,7 +147,7 @@ static Status MatchAndProcess(
RuntimeOptimizationRecord::ProducedOpIdVector produced_op_ids{};
produced_op_ids.reserve(action_saved_state.produced_node_op_schemas.size());

- for (const auto op_schema : action_saved_state.produced_node_op_schemas) {
+ for (const auto& op_schema : action_saved_state.produced_node_op_schemas) {
produced_op_ids.push_back(utils::MakeOpId(*op_schema));
if (save_context->record_produced_node_op_schema) {
status = save_context->record_produced_node_op_schema(*op_schema);
diff --git a/onnxruntime/core/session/inference_session.cc b/onnxruntime/core/session/inference_session.cc
index 023cbcb..8fc17f0 100644
--- a/onnxruntime/core/session/inference_session.cc
+++ b/onnxruntime/core/session/inference_session.cc
@@ -907,7 +907,7 @@ common::Status InferenceSession::SaveToOrtFormat(const std::filesystem::path& fi
ORT_RETURN_IF_ERROR(kernel_type_str_resolver.RegisterGraphNodeOpSchemas(model_->MainGraph()));
ORT_RETURN_IF_ERROR(standalone::RegisterCustomOpNodeSchemas(kernel_type_str_resolver, model_->MainGraph()));

- for (const auto op_schema : saved_runtime_optimization_produced_node_op_schemas_) {
+ for (const auto& op_schema : saved_runtime_optimization_produced_node_op_schemas_) {
ORT_RETURN_IF_ERROR(kernel_type_str_resolver.RegisterOpSchema(*op_schema));
}

2 changes: 2 additions & 0 deletions onnxruntime.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
%define branch cms/v%{realversion}
%define tag efe7f6a3859bedbad40a2991480be4e7584b1582
Source: git+https://github.com/%{github_user}/%{n}.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&submodules=1&output=/%{n}-%{realversion}.tgz
Patch0: onnxruntime-gcc13

BuildRequires: cmake ninja
Requires: protobuf py3-numpy py3-wheel py3-onnx zlib libpng py3-pybind11 re2
%{!?without_cuda:Requires: cuda cudnn}

%prep
%setup -q -n %{n}-%{realversion}
%patch0 -p1

%build
rm -rf ../build; mkdir ../build; cd ../build
Expand Down

0 comments on commit a3d98ce

Please sign in to comment.