Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooBatchCompute Namespace Reference

Namespace for dispatching RooFit computations to various backends. More...

Namespaces

namespace  RF_ARCH
 

Classes

class  BracketAdapter
 Little adapter that gives a bracket operator to types that don't have one. More...
 
class  BracketAdapterWithMask
 
class  Config
 Minimal configuration struct to steer the evaluation of a single node with the RooBatchCompute library. More...
 
struct  ReduceNLLOutput
 
class  RooBatchComputeInterface
 The interface which should be implemented to provide optimised computation functions for implementations of RooAbsReal::computeBatch(). More...
 

Typedefs

typedef std::vector< doubleArgVector
 
typedef const double *__restrict InputArr
 
typedef double *__restrict RestrictArr
 
typedef std::vector< std::span< const double > > VarVector
 

Enumerations

enum class  Architecture {
  AVX512 , AVX2 , AVX , SSE4 ,
  GENERIC , CUDA
}
 
enum  Computer {
  AddPdf , ArgusBG , BMixDecay , Bernstein ,
  BifurGauss , BreitWigner , Bukin , CBShape ,
  Chebychev , ChiSquare , DeltaFunction , DstD0BG ,
  ExpPoly , Exponential , ExponentialNeg , Gamma ,
  GaussModelExpBasis , Gaussian , Identity , Johnson ,
  Landau , Lognormal , LognormalStandard , NegativeLogarithms ,
  NormalizedPdf , Novosibirsk , Poisson , Polynomial ,
  Power , ProdPdf , Ratio , TruthModelExpBasis ,
  TruthModelSinBasis , TruthModelCosBasis , TruthModelLinBasis , TruthModelQuadBasis ,
  TruthModelSinhBasis , TruthModelCoshBasis , Voigtian
}
 

Functions

void compute (Config cfg, Computer comp, RestrictArr output, size_t size, const VarVector &vars)
 
void compute (Config cfg, Computer comp, RestrictArr output, size_t size, const VarVector &vars, ArgVector &extraArgs)
 
Architecture cpuArchitecture ()
 
std::string cpuArchitectureName ()
 
__roodevice__ double fast_cos (double x)
 
__roodevice__ double fast_exp (double x)
 
__roodevice__ double fast_isqrt (double x)
 
__roodevice__ double fast_log (double x)
 
__roodevice__ double fast_sin (double x)
 
bool hasCuda ()
 
void init ()
 Inspect hardware capabilities, and load the optimal library for RooFit computations.
 
ReduceNLLOutput reduceNLL (Config cfg, std::span< const double > probas, std::span< const double > weights, std::span< const double > offsetProbas)
 
double reduceSum (Config cfg, InputArr input, size_t n)
 

Variables

constexpr std::size_t bufferSize = 64
 
R__EXTERN RooBatchComputeInterfacedispatchCPU = nullptr
 This dispatch pointer points to an implementation of the compute library, provided one has been loaded.
 
R__EXTERN RooBatchComputeInterfacedispatchCUDA = nullptr
 

Detailed Description

Namespace for dispatching RooFit computations to various backends.

A space to attach TBranches.

This namespace contains an interface for providing high-performance computation functions for use in RooAbsReal::computeBatch(), see RooBatchComputeInterface.

Furthermore, several implementations of this interface can be created, which reside in RooBatchCompute::RF_ARCH, where RF_ARCH may be replaced by the architecture that this implementation targets, e.g. SSE, AVX, etc.

Using the pointer RooBatchCompute::dispatch, a computation request can be dispatched to the fastest backend that is available on a specific platform.

Typedef Documentation

◆ ArgVector

typedef std::vector<double> RooBatchCompute::ArgVector

Definition at line 48 of file RooBatchCompute.h.

◆ InputArr

typedef const double* __restrict RooBatchCompute::InputArr

Definition at line 50 of file RooBatchCompute.h.

◆ RestrictArr

typedef double* __restrict RooBatchCompute::RestrictArr

Definition at line 49 of file RooBatchCompute.h.

◆ VarVector

typedef std::vector<std::span<const double> > RooBatchCompute::VarVector

Definition at line 47 of file RooBatchCompute.h.

Enumeration Type Documentation

◆ Architecture

enum class RooBatchCompute::Architecture
strong
Enumerator
AVX512 
AVX2 
AVX 
SSE4 
GENERIC 
CUDA 

Definition at line 72 of file RooBatchCompute.h.

◆ Computer

Enumerator
AddPdf 
ArgusBG 
BMixDecay 
Bernstein 
BifurGauss 
BreitWigner 
Bukin 
CBShape 
Chebychev 
ChiSquare 
DeltaFunction 
DstD0BG 
ExpPoly 
Exponential 
ExponentialNeg 
Gamma 
GaussModelExpBasis 
Gaussian 
Identity 
Johnson 
Landau 
Lognormal 
LognormalStandard 
NegativeLogarithms 
NormalizedPdf 
Novosibirsk 
Poisson 
Polynomial 
Power 
ProdPdf 
Ratio 
TruthModelExpBasis 
TruthModelSinBasis 
TruthModelCosBasis 
TruthModelLinBasis 
TruthModelQuadBasis 
TruthModelSinhBasis 
TruthModelCoshBasis 
Voigtian 

Definition at line 74 of file RooBatchCompute.h.

Function Documentation

◆ compute() [1/2]

void RooBatchCompute::compute ( Config  cfg,
Computer  comp,
RestrictArr  output,
size_t  size,
const VarVector vars 
)
inline

Definition at line 196 of file RooBatchCompute.h.

◆ compute() [2/2]

void RooBatchCompute::compute ( Config  cfg,
Computer  comp,
RestrictArr  output,
size_t  size,
const VarVector vars,
ArgVector extraArgs 
)
inline

Definition at line 189 of file RooBatchCompute.h.

◆ cpuArchitecture()

Architecture RooBatchCompute::cpuArchitecture ( )
inline

Definition at line 170 of file RooBatchCompute.h.

◆ cpuArchitectureName()

std::string RooBatchCompute::cpuArchitectureName ( )
inline

Definition at line 176 of file RooBatchCompute.h.

◆ fast_cos()

__roodevice__ double RooBatchCompute::fast_cos ( double  x)
inline

Definition at line 78 of file RooVDTHeaders.h.

◆ fast_exp()

__roodevice__ double RooBatchCompute::fast_exp ( double  x)
inline

Definition at line 68 of file RooVDTHeaders.h.

◆ fast_isqrt()

__roodevice__ double RooBatchCompute::fast_isqrt ( double  x)
inline

Definition at line 88 of file RooVDTHeaders.h.

◆ fast_log()

__roodevice__ double RooBatchCompute::fast_log ( double  x)
inline

Definition at line 83 of file RooVDTHeaders.h.

◆ fast_sin()

__roodevice__ double RooBatchCompute::fast_sin ( double  x)
inline

Definition at line 73 of file RooVDTHeaders.h.

◆ hasCuda()

bool RooBatchCompute::hasCuda ( )
inline

Definition at line 182 of file RooBatchCompute.h.

◆ init()

void RooBatchCompute::init ( )

Inspect hardware capabilities, and load the optimal library for RooFit computations.

Definition at line 44 of file Initialisation.cxx.

◆ reduceNLL()

ReduceNLLOutput RooBatchCompute::reduceNLL ( Config  cfg,
std::span< const double probas,
std::span< const double weights,
std::span< const double offsetProbas 
)
inline

Definition at line 209 of file RooBatchCompute.h.

◆ reduceSum()

double RooBatchCompute::reduceSum ( Config  cfg,
InputArr  input,
size_t  n 
)
inline

Definition at line 202 of file RooBatchCompute.h.

Variable Documentation

◆ bufferSize

constexpr std::size_t RooBatchCompute::bufferSize = 64
constexpr

Definition at line 32 of file Batches.h.

◆ dispatchCPU

RooBatchCompute::RooBatchComputeInterface * RooBatchCompute::dispatchCPU = nullptr

This dispatch pointer points to an implementation of the compute library, provided one has been loaded.

Using a virtual call, computation requests are dispatched to backends with architecture-specific functions such as SSE, AVX, AVX2, etc.

See also
RooBatchComputeInterface, RooBatchComputeClass, RF_ARCH

Definition at line 168 of file RooBatchCompute.h.

◆ dispatchCUDA

RooBatchCompute::RooBatchComputeInterface * RooBatchCompute::dispatchCUDA = nullptr

Definition at line 168 of file RooBatchCompute.h.