ATLAS Offline Software
OnnxRuntimeSessionToolCPU.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2024 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 
14 namespace 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 
34  protected:
38 
39  private:
40  Gaudi::Property<std::string> m_modelFileName{this, "ModelFileName", "", "The model file name"};
41  ServiceHandle<IOnnxRuntimeSvc> m_onnxRuntimeSvc{"AthOnnx::OnnxRuntimeSvc", "AthOnnx::OnnxRuntimeSvc"};
42  std::unique_ptr<Ort::Session> m_session;
43  };
44 }
45 
46 #endif
AthOnnx::OnnxRuntimeSessionToolCPU::m_modelFileName
Gaudi::Property< std::string > m_modelFileName
Definition: OnnxRuntimeSessionToolCPU.h:40
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
PropertyWrapper.h
AthOnnx::OnnxRuntimeSessionToolCPU::m_session
std::unique_ptr< Ort::Session > m_session
Definition: OnnxRuntimeSessionToolCPU.h:42
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
AthOnnx::OnnxRuntimeSessionToolCPU::session
virtual Ort::Session & session() const override final
Create Onnx Runtime session.
Definition: OnnxRuntimeSessionToolCPU.cxx:38
python.oracle.Session
Session
Definition: oracle.py:78
Property
Support class for PropertyMgr.
Definition: Property.h:23
protected
#define protected
Definition: DetDescrConditionsDict_dict_fixes.cxx:14
AthOnnx::OnnxRuntimeSessionToolCPU::OnnxRuntimeSessionToolCPU
OnnxRuntimeSessionToolCPU()=delete
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthOnnx::OnnxRuntimeSessionToolCPU::m_onnxRuntimeSvc
ServiceHandle< IOnnxRuntimeSvc > m_onnxRuntimeSvc
Definition: OnnxRuntimeSessionToolCPU.h:41
IOnnxRuntimeSessionTool.h
AthOnnx::OnnxRuntimeSessionToolCPU
Definition: OnnxRuntimeSessionToolCPU.h:21
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ServiceHandle.h
IOnnxRuntimeSvc.h
calibdata.delete
list delete
Definition: calibdata.py:46
ASG_TOOL_CLASS
#define ASG_TOOL_CLASS(CLASSNAME, INT1)
Definition: AsgToolMacros.h:68
Gaudi
=============================================================================
Definition: CaloGPUClusterAndCellDataMonitorOptions.h:273
AthOnnx::OnnxRuntimeSessionToolCPU::~OnnxRuntimeSessionToolCPU
virtual ~OnnxRuntimeSessionToolCPU()=default
AthOnnx::IOnnxRuntimeSessionTool
Definition: IOnnxRuntimeSessionTool.h:18
AsgTool.h
AthOnnx::OnnxRuntimeSessionToolCPU::initialize
virtual StatusCode initialize() override final
Initialize the tool.
Definition: OnnxRuntimeSessionToolCPU.cxx:13
ServiceHandle
Definition: ClusterMakerTool.h:37
AthOnnx
Namespace holding all of the Onnx Runtime example code.
Definition: EvaluateModel.cxx:11