Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support building with onnxruntime 17.1 #81

Merged
merged 2 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ find_package(EDM4HEP 0.10.1) # implicit: Podio
find_package(DD4hep)
find_package(k4geo)
find_package(ONNXRuntime)
# New versions of ONNRuntime package provide onnxruntime-Config.cmake
# and use the name onnxruntime
find_package(onnxruntime)
#---------------------------------------------------------------


Expand Down
5 changes: 5 additions & 0 deletions RecFCCeeCalorimeter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
include_directories("${ONNXRUNTIME_INCLUDE_DIRS}")
# libs
link_directories("${ONNXRUNTIME_LIBRARY_DIRS}")
# New versions of ONNXRuntime add directories to include
# through the target onnxruntime::onnxruntime
if(onnxruntime_FOUND)
set(ONNXRUNTIME_LIBRARY onnxruntime::onnxruntime)
endif()

file(GLOB _module_sources src/components/*.cpp)
gaudi_add_module(k4RecFCCeeCalorimeterPlugins
Expand Down
4 changes: 2 additions & 2 deletions RecFCCeeCalorimeter/src/components/CalibrateCaloClusters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ StatusCode CalibrateCaloClusters::readCalibrationFile(const std::string &calibra
debug() << "Input Node Name/Shape (" << m_input_names.size() << "):" << endmsg;
for (std::size_t i = 0; i < m_ortSession->GetInputCount(); i++)
{
m_input_names.emplace_back(m_ortSession->GetInputName(i, allocator));
m_input_names.insert(m_input_names.end(), m_ortSession->GetInputNames().begin(), m_ortSession->GetInputNames().end());
m_input_shapes = m_ortSession->GetInputTypeInfo(i).GetTensorTypeAndShapeInfo().GetShape();
debug() << "\t" << m_input_names.at(i) << " : ";
for (std::size_t k = 0; k < m_input_shapes.size() - 1; k++)
Expand All @@ -263,7 +263,7 @@ StatusCode CalibrateCaloClusters::readCalibrationFile(const std::string &calibra
debug() << "Output Node Name/Shape (" << m_output_names.size() << "):" << endmsg;
for (std::size_t i = 0; i < m_ortSession->GetOutputCount(); i++)
{
m_output_names.emplace_back(m_ortSession->GetOutputName(i, allocator));
m_output_names.insert(m_output_names.end(), m_ortSession->GetOutputNames().begin(), m_ortSession->GetOutputNames().end());
m_output_shapes = m_ortSession->GetOutputTypeInfo(i).GetTensorTypeAndShapeInfo().GetShape();
debug() << "\t" << m_output_names.at(i) << " : ";
for (std::size_t k = 0; k < m_output_shapes.size() - 1; k++)
Expand Down
Loading