Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROperator.hxx
Go to the documentation of this file.
1#ifndef TMVA_SOFIE_ROPERATOR
2#define TMVA_SOFIE_ROPERATOR
3
4#include <vector>
5#include <memory>
6
8//#include "RModel.hxx"
9
10
11
12namespace TMVA{
13namespace Experimental{
14namespace SOFIE{
15
16class RModel;
17
19
20
21public:
22 virtual std::vector<std::string> GetBlasRoutines() { return {}; }
23 virtual std::vector<std::string> GetStdLibs() { return {}; }
24 virtual std::vector<std::vector<size_t>> ShapeInference(std::vector<std::vector<size_t>>) = 0;
25 virtual std::vector<ETensorType> TypeInference(std::vector<ETensorType>) = 0;
26 virtual void Initialize(RModel&) = 0;
27 virtual std::string Generate(std::string OpName) = 0; //expect unique opName for each operator within the same RModel
28 // generate initialization code for session constructor
29 virtual std::string GenerateInitCode() { return "";}
30 // generate some specific declaration code for Session
31 virtual std::string GenerateDeclCode() { return "";}
32 // generate session data members specific to operator
33 virtual std::string GenerateSessionMembersCode(std::string /*opName*/) { return ""; }
34 virtual std::string Header() { return "";}
35
36
37 //virtual void Forward_reference() = 0;
38 //virtual void Forward_blas() = 0;
39 virtual ~ROperator(){}
40
41protected:
42
43 const std::string SP = " "; ///< space used to correctly indent the generated C++ code
44 bool fUseSession = false; ///< flag to identify if using the session class
45 bool fIsOutputConstant = false; ///< flag to identify if operator has a constant output (no need to generate code)
46};
47
48
49
50}//SOFIE
51}//Experimental
52}//TMVA
53
54
55#endif //TMVA_SOFIE_OPERATOR
virtual std::vector< std::string > GetBlasRoutines()
Definition ROperator.hxx:22
virtual void Initialize(RModel &)=0
bool fIsOutputConstant
flag to identify if operator has a constant output (no need to generate code)
Definition ROperator.hxx:45
virtual std::string GenerateInitCode()
Definition ROperator.hxx:29
const std::string SP
space used to correctly indent the generated C++ code
Definition ROperator.hxx:43
virtual std::vector< ETensorType > TypeInference(std::vector< ETensorType >)=0
virtual std::string GenerateSessionMembersCode(std::string)
Definition ROperator.hxx:33
virtual std::vector< std::vector< size_t > > ShapeInference(std::vector< std::vector< size_t > >)=0
bool fUseSession
flag to identify if using the session class
Definition ROperator.hxx:44
virtual std::string Generate(std::string OpName)=0
virtual std::string GenerateDeclCode()
Definition ROperator.hxx:31
virtual std::vector< std::string > GetStdLibs()
Definition ROperator.hxx:23
create variable transformations