Skip to content

Commit 9da1a8c

Browse files
committed
Add support for ONNXRuntime 1.17.1
Notice that this includes a fix to give precedence to the old ONNXRuntime. Without this, it will currently prefer (non-working) local installations.
1 parent dd35564 commit 9da1a8c

File tree

6 files changed

+30
-7
lines changed

6 files changed

+30
-7
lines changed

Detectors/TRD/pid/include/TRDPID/ML.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@
2121
#include "DataFormatsTRD/PID.h"
2222
#include "Framework/ProcessingContext.h"
2323
#include "Framework/InputRecord.h"
24+
#if __has_include(<onnxruntime/core/session/experimental_onnxruntime_cxx_api.h>)
2425
#include <onnxruntime/core/session/experimental_onnxruntime_cxx_api.h>
26+
#else
27+
#include <onnxruntime_cxx_api.h>
28+
#endif
2529
#include <memory>
2630
#include <vector>
2731
#include <array>

Detectors/TRD/pid/src/ML.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@
2828
#include "DetectorsBase/Propagator.h"
2929

3030
#include <fmt/format.h>
31+
#if __has_include(<onnxruntime/core/session/experimental_onnxruntime_cxx_api.h>)
3132
#include <onnxruntime/core/session/experimental_onnxruntime_cxx_api.h>
33+
#else
34+
#include <onnxruntime_cxx_api.h>
35+
#endif
3236
#include <boost/range.hpp>
3337

3438
#include <array>

Detectors/ZDC/fastsimulation/include/FastSimulations.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
#ifndef O2_ZDC_FAST_SIMULATIONS_H
1818
#define O2_ZDC_FAST_SIMULATIONS_H
1919

20+
#if __has_include(<onnxruntime/core/session/onnxruntime_cxx_api.h>)
2021
#include <onnxruntime/core/session/onnxruntime_cxx_api.h>
22+
#else
23+
#include <onnxruntime_cxx_api.h>
24+
#endif
2125
#include <optional>
2226
#include <mutex>
2327

Detectors/ZDC/fastsimulation/include/Processors.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
#ifndef O2_ZDC_FAST_SIMULATIONS_PROCESSORS_H
1818
#define O2_ZDC_FAST_SIMULATIONS_PROCESSORS_H
1919

20+
#if __has_include(<onnxruntime/core/session/onnxruntime_cxx_api.h>)
2021
#include <onnxruntime/core/session/onnxruntime_cxx_api.h>
22+
#else
23+
#include <onnxruntime_cxx_api.h>
24+
#endif
2125
#include <optional>
2226
#include <vector>
2327

Detectors/ZDC/simulation/include/ZDCSimulation/Detector.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,13 @@
2626

2727
// inclusions and forward decl for fast sim
2828
#ifdef ZDC_FASTSIM_ONNX
29+
30+
#if __has_include(<onnxruntime/core/session/onnxruntime_cxx_api.h>)
2931
#include <onnxruntime/core/session/onnxruntime_cxx_api.h>
32+
#else
33+
#include <onnxruntime_cxx_api.h>
34+
#endif
35+
3036
namespace o2::zdc
3137
{
3238
namespace fastsim

dependencies/FindONNXRuntime.cmake

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
# granted to it by virtue of its status as an Intergovernmental Organization
1010
# or submit itself to any jurisdiction.
1111

12-
find_package(onnxruntime CONFIG)
13-
if (NOT onnxruntime_FOUND)
14-
find_package(ONNXRuntime::ONNXRuntime CONFIG)
15-
if (ONNXRuntime::ONNXRuntime_FOUND)
16-
set(onnxruntime_FOUND 1)
17-
add_library(onnxruntime::onnxruntime ALIAS ONNXRuntime::ONNXRuntime)
18-
endif()
12+
find_package(ONNXRuntime::ONNXRuntime CONFIG)
13+
if (ONNXRuntime::ONNXRuntime_FOUND)
14+
set(onnxruntime_FOUND 1)
15+
add_library(onnxruntime::onnxruntime ALIAS ONNXRuntime::ONNXRuntime)
16+
endif()
17+
18+
if (NOT ONNXRuntime::ONNXRuntime_FOUND)
19+
find_package(onnxruntime CONFIG)
1920
endif()

0 commit comments

Comments
 (0)