Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
SOFIE_common_helpers.cxx File Reference
Include dependency graph for SOFIE_common_helpers.cxx:

Classes

class  SafetensorsReader
 

Namespaces

namespace  TMVA
 create variable transformations
 
namespace  TMVA::Experimental
 
namespace  TMVA::Experimental::SOFIE
 

Functions

void TMVA::Expect (char c)
 
void TMVA::ExpectLiteral (const char *literal)
 
void TMVA::Fail (const std::string &message)
 
HelperFunctionsCode GenerateHelperFunctionsCode (const std::set< std::string > &neededHelpers, const std::string &modelNamespace, bool sgemmAlreadyDeclared)
 
 TMVA::Experimental::if (fPos !=fText.size()) Fail("unexpected trailing content")
 
std::uint32_t TMVA::ParseHexEscape ()
 
std::string TMVA::ParseString (bool keep)
 
void TMVA::ParseTensorEntry (const std::string &name, std::unordered_map< std::string, SafetensorsTensorInfo > &tensors)
 
std::uint64_t TMVA::ParseUInt ()
 
char TMVA::Peek ()
 
void TMVA::SkipNumber ()
 
void TMVA::SkipValue ()
 
 TMVA::Experimental::SkipWhitespace ()
 
void TMVA::SkipWhitespace ()
 
bool TMVA::TryConsume (char c)
 

Variables

constexpr const char * kDynamicMemory
 
constexpr const char * kInputTensorDims
 
 SOFIE
 

Detailed Description

Standalone definitions of the SOFIE inference helpers (Im2col, Gemm_Call, ...).

RModel records which helpers a model needs (RModel::AddNeededHelperFunction) and dumps only those into the generated namespace, so the emitted header is self-contained (no TMVA/SOFIE_common.hxx include). These are dependency-free copies of the SOFIE_common.hxx originals: keep them in sync when those change.

Definition in file SOFIE_common_helpers.cxx.

Function Documentation

◆ GenerateHelperFunctionsCode()

HelperFunctionsCode GenerateHelperFunctionsCode ( const std::set< std::string > & neededHelpers,
const std::string & modelNamespace,
bool sgemmAlreadyDeclared )

Definition at line 1160 of file SOFIE_common_helpers.cxx.

Variable Documentation

◆ kDynamicMemory

constexpr const char* kDynamicMemory
constexpr

Definition at line 1031 of file SOFIE_common_helpers.cxx.

◆ kInputTensorDims

constexpr const char* kInputTensorDims
constexpr
Initial value:
= R"SOFIE(
struct SingleDim {
enum class Kind { Static, Symbolic };
Kind kind;
std::size_t dim;
std::string_view name;
constexpr SingleDim(std::size_t v) : kind(Kind::Static), dim(v), name() {}
constexpr SingleDim(const char *v) : kind(Kind::Symbolic), dim(0), name(v) {}
};
struct TensorDims {
const SingleDim *data;
std::size_t size;
constexpr std::size_t total_size() const
{
std::size_t result = 1;
for (std::size_t i = 0; i < size; ++i) {
result *= data[i].dim;
}
return result;
}
};
template <class Arr>
constexpr TensorDims makeDims(Arr const &arr)
{
return TensorDims{arr.data(), arr.size()};
}
)SOFIE"

Definition at line 1001 of file SOFIE_common_helpers.cxx.

◆ SOFIE

SOFIE

Definition at line 997 of file SOFIE_common_helpers.cxx.