Commit f08abd91 authored by Qipeng Hu's avatar Qipeng Hu
Browse files

add simple AthOnnxTool

parent a9d9a15f
#ifndef AthExOnnxRuntime_AthOnnxTool_H
#define AthExOnnxRuntime_AthOnnxTool_H
// System include(s):
#include <vector>
#include <string>
// Framework include(s):
#include "AsgTools/AsgTool.h"
// Local include(s):
#include "IAthOnnxTool.h"
class AthOnnxTool : virtual public IAthOnnxTool,
public asg::AsgTool {
// Declare the proper constructor(s) for Athena:
ASG_TOOL_CLASS( AthOnnxTool, IAthOnnxTool )
public:
AthOnnxTool( const std::string& name =
"AthOnnxTool" );
/// Initialize AlgTool
virtual StatusCode initialize();
virtual bool sayHello() const;
}; // class AthOnnxTool
#endif // AthExOnnxRuntime_AthOnnxTool_H
#ifndef AthExOnnxRuntime_IAthOnnxTool_H
#define AthExOnnxRuntime_IAthOnnxTool_H
// System include(s):
#include <vector>
#include <string>
// Framework include(s):
#include "AsgTools/IAsgTool.h"
///Main tools implementing this interface:
class IAthOnnxTool : virtual public asg::IAsgTool {
ASG_TOOL_INTERFACE( IAthOnnxTool )
public:
/// Check if the current event passes the selection
virtual bool sayHello() const = 0;
}; // class IAthOnnxTool
#endif // AthExOnnxRuntime_IAthOnnxTool_H
......@@ -5,10 +5,12 @@ atlas_subdir( AthExOnnxRuntime )
# Component(s) in the package.
atlas_add_library( AthExOnnxRuntimeLib
INTERFACE
AthExOnnxRuntime/*.h Root/*.cxx
SHARED
PUBLIC_HEADERS AthExOnnxRuntime
INCLUDE_DIRS ${ONNXRUNTIME_INCLUDE_DIRS}
LINK_LIBRARIES ${ONNXRUNTIME_LIBRARIES} GaudiKernel )
LINK_LIBRARIES ${ONNXRUNTIME_LIBRARIES} GaudiKernel
PRIVATE_LINK_LIBRARIES PathResolver)
atlas_add_component( AthExOnnxRuntime
src/*.h src/*.cxx src/components/*.cxx
......
// Local include(s):
#include "AthExOnnxRuntime/AthOnnxTool.h"
// Framework include(s):
#include "PathResolver/PathResolver.h"
AthOnnxTool::AthOnnxTool( const std::string& name )
: asg::AsgTool( name ) {
}
StatusCode AthOnnxTool::initialize() {
// Tell the user what's happening:
ATH_MSG_DEBUG( "Initialising tool" );
return StatusCode::SUCCESS;
}
bool AthOnnxTool:: sayHello( ) const {
ATH_MSG_INFO( "Hello World! said by AthOnnxTool" );
return true;
}
......@@ -2,5 +2,7 @@
// Local include(s).
#include "../EvaluateModel.h"
#include "AthExOnnxRuntime/AthOnnxTool.h"
// Declare the package's components.
DECLARE_COMPONENT( AthONNX::EvaluateModel )
DECLARE_COMPONENT( AthOnnxTool )
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment