ATLAS Offline Software
Loading...
Searching...
No Matches
OnnxRuntimeSessionToolCPU.h
Go to the documentation of this file.
1// Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3#ifndef OnnxRuntimeSessionToolCPU_H
4#define OnnxRuntimeSessionToolCPU_H
5
6#include "AsgTools/AsgTool.h"
11
12#include <string>
13
14namespace AthOnnx {
15 // @class OnnxRuntimeSessionToolCPU
16 //
17 // @brief Tool to create Onnx Runtime session with CPU backend
18 //
19 // @author Xiangyang Ju <xiangyang.ju@cern.ch>
21 {
23 public:
25 OnnxRuntimeSessionToolCPU( const std::string& name );
26 virtual ~OnnxRuntimeSessionToolCPU() = default;
27
29 virtual StatusCode initialize() override final;
30
32 virtual Ort::Session& session() const override final;
33
38
39 private:
40 Gaudi::Property<std::string> m_modelFileName{this, "ModelFileName", "", "The model file name"};
41 ServiceHandle<IOnnxRuntimeSvc> m_onnxRuntimeSvc{this, "OnnxRuntimeSvc", "AthOnnx::OnnxRuntimeSvc/OnnxRuntimeSvc", "The Onnx runtime service"};
42 std::unique_ptr<Ort::Session> m_session;
43 };
44}
45
46#endif
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
#define protected
std::unique_ptr< Ort::Session > m_session
virtual ~OnnxRuntimeSessionToolCPU()=default
virtual Ort::Session & session() const override final
Create Onnx Runtime session.
virtual StatusCode initialize() override final
Initialize the tool.
ServiceHandle< IOnnxRuntimeSvc > m_onnxRuntimeSvc
OnnxRuntimeSessionToolCPU(const std::string &name)
Standard constructor.
Gaudi::Property< std::string > m_modelFileName
Support class for PropertyMgr.
Definition Property.h:23
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
Namespace holding all of the Onnx Runtime example code.
=============================================================================
STL namespace.
#define private