Logo ROOT  
Reference Guide
RooBatchCompute.h
Go to the documentation of this file.
1#ifndef ROOFIT_BATCHCOMPUTE_ROOBATCHCOMPUTE_H
2#define ROOFIT_BATCHCOMPUTE_ROOBATCHCOMPUTE_H
3
4#include "RooSpan.h"
5#include "RooVDTHeaders.h"
6#include "RunContext.h"
7#include "BracketAdapter.h"
8#include "DllImport.h" //for R__EXTERN, needed for windows
9
10class RooAbsReal;
11class RooListProxy;
12
13/**
14 * Namespace for dispatching RooFit computations to various backends.
15 *
16 * This namespace contains an interface for providing high-performance computation functions for use in RooAbsReal::evaluateSpan(),
17 * see RooBatchComputeInterface.
18 *
19 * Furthermore, several implementations of this interface can be created, which reside in RooBatchCompute::RF_ARCH, where
20 * RF_ARCH may be replaced by the architecture that this implementation targets, e.g. SSE, AVX, etc.
21 *
22 * Using the pointer RooBatchCompute::dispatch, a computation request can be dispatched to the fastest backend that is available
23 * on a specific platform.
24 */
25namespace RooBatchCompute {
26 /**
27 * \brief The interface which should be implemented to provide optimised computation functions for implementations of RooAbsReal::evaluateSpan().
28 *
29 * This interface contains the signatures of the compute functions of every PDF that has an optimised implementation available.
30 * These are the functions that perform the actual computations in batches.
31 *
32 * Several implementations of this interface may be provided, e.g. SSE, AVX, AVX2 etc. At run time, the fastest implementation of this interface
33 * is selected, and using a virtual call, the computation is dispatched to the best backend.
34 *
35 * \see RooBatchCompute::dispatch, RooBatchComputeClass, RF_ARCH
36 */
38 public:
39 virtual ~RooBatchComputeInterface() = default;
41 virtual void computeBernstein(size_t batchSize, double * __restrict output, const double * __restrict const xData, double xmin, double xmax, std::vector<double> coef) = 0;
46 virtual void computeChebychev(size_t batchSize, double * __restrict output, const double * __restrict const xData, double xmin, double xmax, std::vector<double> coef) = 0;
56 virtual RooSpan<double> computePoisson(const RooAbsReal*, RunContext&, RooSpan<const double> x, RooSpan<const double> mean, bool protectNegative, bool noRounding) = 0;
57 virtual void computePolynomial(size_t batchSize, double * __restrict output, const double * __restrict const xData, int lowestOrder, std::vector<BracketAdapterWithMask> &coef) = 0;
59 };
60
61 /**
62 * This dispatch pointer points to an implementation of the compute library, provided one has been loaded.
63 * Using a virtual call, computation requests are dispatched to backends with architecture-specific functions
64 * such as SSE, AVX, AVX2, etc.
65 *
66 * \see RooBatchComputeInterface, RooBatchComputeClass, RF_ARCH
67 */
69}
70
71#endif
#define R__EXTERN
Definition: DllImport.h:27
#define c(i)
Definition: RSha256.hxx:101
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
float xmin
Definition: THbookFile.cxx:95
float xmax
Definition: THbookFile.cxx:95
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:61
The interface which should be implemented to provide optimised computation functions for implementati...
virtual RooSpan< double > computeGamma(const RooAbsReal *, RunContext &, RooSpan< const double > x, RooSpan< const double > gamma, RooSpan< const double > beta, RooSpan< const double > mu)=0
virtual RooSpan< double > computeBreitWigner(const RooAbsReal *, RunContext &, RooSpan< const double > x, RooSpan< const double > mean, RooSpan< const double > width)=0
virtual RooSpan< double > computeVoigtian(const RooAbsReal *, RunContext &, RooSpan< const double > x, RooSpan< const double > mean, RooSpan< const double > width, RooSpan< const double > sigma)=0
virtual RooSpan< double > computeDstD0BG(const RooAbsReal *, RunContext &, RooSpan< const double > dm, RooSpan< const double > dm0, RooSpan< const double > C, RooSpan< const double > A, RooSpan< const double > B)=0
virtual RooSpan< double > computeBifurGauss(const RooAbsReal *, RunContext &, RooSpan< const double > x, RooSpan< const double > mean, RooSpan< const double > sigmaL, RooSpan< const double > sigmaR)=0
virtual void computeBernstein(size_t batchSize, double *__restrict output, const double *__restrict const xData, double xmin, double xmax, std::vector< double > coef)=0
virtual RooSpan< double > computeLognormal(const RooAbsReal *, RunContext &, RooSpan< const double > x, RooSpan< const double > m0, RooSpan< const double > k)=0
virtual RooSpan< double > computeGaussian(const RooAbsReal *, RunContext &, RooSpan< const double > x, RooSpan< const double > mean, RooSpan< const double > sigma)=0
virtual RooSpan< double > computeChiSquare(const RooAbsReal *, RunContext &, RooSpan< const double > x, RooSpan< const double > ndof)=0
virtual RooSpan< double > computeArgusBG(const RooAbsReal *, RunContext &, RooSpan< const double > m, RooSpan< const double > m0, RooSpan< const double > c, RooSpan< const double > p)=0
virtual void computePolynomial(size_t batchSize, double *__restrict output, const double *__restrict const xData, int lowestOrder, std::vector< BracketAdapterWithMask > &coef)=0
virtual RooSpan< double > computeExponential(const RooAbsReal *, RunContext &, RooSpan< const double > x, RooSpan< const double > c)=0
virtual RooSpan< double > computeJohnson(const RooAbsReal *, RunContext &, RooSpan< const double > mass, RooSpan< const double > mu, RooSpan< const double > lambda, RooSpan< const double > gamma, RooSpan< const double > delta, double massThreshold)=0
virtual void computeChebychev(size_t batchSize, double *__restrict output, const double *__restrict const xData, double xmin, double xmax, std::vector< double > coef)=0
virtual RooSpan< double > computeNovosibirsk(const RooAbsReal *, RunContext &, RooSpan< const double > x, RooSpan< const double > peak, RooSpan< const double > width, RooSpan< const double > tail)=0
virtual RooSpan< double > computeBukin(const RooAbsReal *, RunContext &, RooSpan< const double > x, RooSpan< const double > Xp, RooSpan< const double > sigp, RooSpan< const double > xi, RooSpan< const double > rho1, RooSpan< const double > rho2)=0
virtual RooSpan< double > computeCBShape(const RooAbsReal *, RunContext &, RooSpan< const double > m, RooSpan< const double > m0, RooSpan< const double > sigma, RooSpan< const double > alpha, RooSpan< const double > n)=0
virtual RooSpan< double > computeLandau(const RooAbsReal *, RunContext &, RooSpan< const double > x, RooSpan< const double > mean, RooSpan< const double > sigma)=0
virtual RooSpan< double > computePoisson(const RooAbsReal *, RunContext &, RooSpan< const double > x, RooSpan< const double > mean, bool protectNegative, bool noRounding)=0
RooListProxy is the concrete proxy for RooArgList objects.
Definition: RooListProxy.h:24
A simple container to hold a batch of data values.
Definition: RooSpan.h:34
double beta(double x, double y)
Calculates the beta function.
const Double_t sigma
Double_t x[n]
Definition: legend1.C:17
const Int_t n
Definition: legend1.C:16
static double B[]
static double A[]
static double C[]
double gamma(double x)
Namespace for dispatching RooFit computations to various backends.
R__EXTERN RooBatchComputeInterface * dispatch
This dispatch pointer points to an implementation of the compute library, provided one has been loade...
This struct enables passing computation data around between elements of a computation graph.
Definition: RunContext.h:31
auto * m
Definition: textangle.C:8
static void output(int code)
Definition: gifencode.c:226