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).
11
12// ONNX include(s).
13#include <onnxruntime_cxx_api.h>
14
15// System include(s).
16#include <memory>
17
18namespace AthOnnx {
19
27 class OnnxRuntimeSvc : public extends<asg::AsgService, IOnnxRuntimeSvc> {
28
29 public:
30
33 OnnxRuntimeSvc (const std::string& name, ISvcLocator* svc);
34
36 virtual StatusCode initialize() override;
38 virtual StatusCode finalize() override;
39
41
44
46 virtual Ort::Env& env() const override;
47
49
50 private:
52 std::unique_ptr< Ort::Env > m_env;
53
54 }; // class OnnxRuntimeSvc
55
56} // namespace AthOnnx
57
58#endif // ATHONNX_ONNXRUNTIMESVC_H
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.