ATLAS Offline Software
Loading...
Searching...
No Matches
OnnxRuntimeSvc.h
Go to the documentation of this file.
1// Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3#ifndef ATHONNX_ONNXRUNTIMESVC_H
4#define ATHONNX_ONNXRUNTIMESVC_H
5
6// Local include(s).
8
9// Framework include(s).
12
13// ONNX include(s).
14#include <onnxruntime_cxx_api.h>
15
16// System include(s).
17#include <memory>
18
19namespace AthOnnx {
20
28 class OnnxRuntimeSvc : public extends<asg::AsgService, IOnnxRuntimeSvc> {
29
30 public:
31
34 OnnxRuntimeSvc (const std::string& name, ISvcLocator* svc);
35
37 virtual StatusCode initialize() override;
39 virtual StatusCode finalize() override;
40
42
45
47 virtual Ort::Env& env() const override;
48
50
51 private:
53 Gaudi::Property<int> m_logLevel{this, "LogLevel", 2, "ONNX Runtime logging level (0=VERBOSE, 1=INFO, 2=WARNING, 3=ERROR, 4=FATAL)"};
54
56 std::unique_ptr< Ort::Env > m_env;
57
58 }; // class OnnxRuntimeSvc
59
60} // namespace AthOnnx
61
62#endif // ATHONNX_ONNXRUNTIMESVC_H
Gaudi::Property< int > m_logLevel
ONNX Runtime logging level (0=VERBOSE, 1=INFO, 2=WARNING, 3=ERROR, 4=FATAL).
std::unique_ptr< Ort::Env > m_env
Global runtime environment for Onnx Runtime.
virtual Ort::Env & env() const override
Return the Onnx Runtime environment object.
virtual StatusCode finalize() override
Function finalising the service.
virtual StatusCode initialize() override
Function initialising the service.
OnnxRuntimeSvc(const std::string &name, ISvcLocator *svc)
Namespace holding all of the Onnx Runtime example code.