7namespace Experimental {
15 fGC += (
"//Code generated automatically by TMVA for Inference of Model file [" +
fFileName +
"] at [" +
fParseTime.substr(0,
fParseTime.length()-1) +
"] \n");
18 std::transform(hgname.begin(), hgname.end(), hgname.begin(), [](
unsigned char c) {
19 return std::toupper(c);
21 hgname =
"ROOT_TMVA_SOFIE_" + hgname;
22 fGC +=
"\n#ifndef " + hgname +
"\n";
23 fGC +=
"#define " + hgname +
"\n\n";
25 fGC +=
"#include <" + i +
">\n";
28 fGC +=
"#include \"" + i +
"\"\n";
32 fGC +=
"#include \"TMVA/SOFIE_common.hxx\"\n";
34 fGC +=
"#include <fstream>\n";
37 fGC +=
"#include \"TFile.h\"\n";
39 fGC +=
"\nnamespace TMVA_SOFIE_" +
fName +
"{\n";
41 fGC += (
"namespace BLAS{\n");
43 if (routine ==
"Gemm") {
44 fGC += (
"\textern \"C\" void sgemm_(const char * transa, const char * transb, const int * m, const int * n, const int * k,\n"
45 "\t const float * alpha, const float * A, const int * lda, const float * B, const int * ldb,\n"
46 "\t const float * beta, float * C, const int * ldc);\n");
47 }
else if (routine ==
"Gemv") {
48 fGC += (
"\textern \"C\" void sgemv_(const char * trans, const int * m, const int * n, const float * alpha, const float * A,\n"
49 "\t const int * lda, const float * X, const int * incx, const float * beta, const float * Y, const int * incy);\n");
50 }
else if (routine ==
"Axpy") {
51 fGC += (
"\textern \"C\" void saxpy_(const int * n, const float * alpha, const float * x,\n"
52 "\t const int * incx, float * y, const int * incy);\n");
53 }
else if (routine ==
"Copy") {
54 fGC += (
"\textern \"C\" void scopy_(const int *n, const float* x, const int *incx, float* y, const int* incy);\n");
74 throw std::runtime_error(
"tmva-sofie failed to open file for output generated inference code");
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
void GenerateHeaderInfo(std::string &hgname)
std::unordered_set< std::string > fNeededBlasRoutines
std::unordered_set< std::string > fCustomOpHeaders
void OutputGenerated(std::string filename="", bool append=false)
std::unordered_set< std::string > fNeededStdLib
WeightFileType fWeightFile
create variable transformations