Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RModel_Base.hxx
Go to the documentation of this file.
1#ifndef TMVA_SOFIE_RMODEL_BASE
2#define TMVA_SOFIE_RMODEL_BASE
3
4#include <type_traits>
5#include <unordered_set>
6#include <vector>
7#include <unordered_map>
8#include <memory>
9#include <ctime>
10#include <set>
11#include <iomanip>
12#include <fstream>
13#include <sstream>
14#include "TMVA/SOFIE_common.hxx"
15#include "TMVA/ROperator.hxx"
16#include "TBuffer.h"
17
18namespace TMVA {
19namespace Experimental {
20namespace SOFIE {
21
22enum class Options {
23 kDefault = 0x0,
24 kNoSession = 0x1,
25 kNoWeightFile = 0x2,
27 kGNN = 0x8,
28 kGNNComponent = 0x10,
29};
30
32
33std::underlying_type_t<Options> operator|(Options opA, Options opB);
34std::underlying_type_t<Options> operator|(std::underlying_type_t<Options> opA, Options opB);
35
36class RModel_Base: public TObject {
37
38protected:
39 std::string fFileName; //file name of original model file for identification
40 std::string fParseTime; //UTC date and time string at parsing
41
43
44 std::unordered_set<std::string> fNeededBlasRoutines;
45
46 const std::unordered_set<std::string> fAllowedStdLib = {"vector", "algorithm", "cmath"};
47 std::unordered_set<std::string> fNeededStdLib = {"vector"};
48 std::unordered_set<std::string> fCustomOpHeaders;
49
50 std::string fName="UnnamedModel";
51 std::string fGC; //generated code
52 bool fUseWeightFile = true;
53 bool fUseSession = true;
54 bool fIsGNN = false;
55 bool fIsGNNComponent = false;
56
57public:
59
60 RModel_Base(std::string name, std::string parsedtime);
61
62 // For GNN Functions usage
63 RModel_Base(std::string function_name):fName(function_name) {}
64
65 void AddBlasRoutines(std::vector<std::string> routines) {
66 for (auto &routine : routines) {
67 fNeededBlasRoutines.insert(routine);
68 }
69 }
70 void AddNeededStdLib(std::string libname) {
71 if (fAllowedStdLib.find(libname) != fAllowedStdLib.end()) {
72 fNeededStdLib.insert(libname);
73 }
74 }
75 void AddNeededCustomHeader(std::string filename) {
77 }
78 void GenerateHeaderInfo(std::string& hgname);
80 std::cout << fGC;
81 }
82
83 std::string ReturnGenerated() {
84 return fGC;
85 }
86 void OutputGenerated(std::string filename = "", bool append = false);
87 void SetFilename(std::string filename) {
89 }
90 std::string GetFilename() {
91 return fName;
92 }
93
95
96};
97
98enum class GraphType {
100};
101
102enum class FunctionType {
103 UPDATE=0, AGGREGATE=1
104};
105enum class FunctionTarget {
106 INVALID=0, NODES=1, EDGES=2, GLOBALS=3
107};
108enum class FunctionReducer {
109 INVALID=0, SUM=1, MEAN=2
110};
113};
114
116public:
118 virtual void Generate() = 0;
119};
120
121}//SOFIE
122}//Experimental
123}//TMVA
124
125#endif //TMVA_SOFIE_RMODEL_BASE
#define ClassDef(name, id)
Definition Rtypes.h:337
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
char name[80]
Definition TGX11.cxx:110
void GenerateHeaderInfo(std::string &hgname)
std::unordered_set< std::string > fNeededBlasRoutines
const std::unordered_set< std::string > fAllowedStdLib
RModel_Base(std::string function_name)
std::unordered_set< std::string > fCustomOpHeaders
void OutputGenerated(std::string filename="", bool append=false)
std::unordered_set< std::string > fNeededStdLib
void AddBlasRoutines(std::vector< std::string > routines)
void AddNeededStdLib(std::string libname)
void AddNeededCustomHeader(std::string filename)
void SetFilename(std::string filename)
Mother of all ROOT objects.
Definition TObject.h:41
std::underlying_type_t< Options > operator|(Options opA, Options opB)
Definition RModel.cxx:16
create variable transformations