13#ifndef ROOFIT_BATCHCOMPUTE_ROOBATCHCOMPUTE_H
14#define ROOFIT_BATCHCOMPUTE_ROOBATCHCOMPUTE_H
47typedef std::vector<std::span<const double>>
VarVector;
59 bool useCuda()
const {
return _cudaStream !=
nullptr; }
155 std::span<const double> weightSpan, std::span<const double> weights,
156 double weightSum, std::span<const double> binVolumes) = 0;
211 std::span<const double> weights,
double weightSum, std::span<const double> binVolumes)
215 return dispatch->
reduceNLL(cfg, probas, weightSpan, weights, weightSum, binVolumes);
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
The Kahan summation is a compensated summation algorithm, which significantly reduces numerical error...
Minimal configuration struct to steer the evaluation of a single node with the RooBatchCompute librar...
The interface which should be implemented to provide optimised computation functions for implementati...
virtual double reduceSum(Config const &cfg, InputArr input, size_t n)=0
void compute(Config const &cfg, Computer comp, RestrictArr output, size_t size, const VarVector &vars)
virtual std::string architectureName() const =0
virtual void compute(Config const &cfg, Computer, RestrictArr, size_t, const VarVector &, ArgVector &)=0
virtual Architecture architecture() const =0
virtual ReduceNLLOutput reduceNLL(Config const &cfg, std::span< const double > probas, std::span< const double > weightSpan, std::span< const double > weights, double weightSum, std::span< const double > binVolumes)=0
virtual ~RooBatchComputeInterface()=default
Namespace for dispatching RooFit computations to various backends.
R__EXTERN RooBatchComputeInterface * dispatchCUDA
std::string cpuArchitectureName()
R__EXTERN RooBatchComputeInterface * dispatchCPU
This dispatch pointer points to an implementation of the compute library, provided one has been loade...
std::vector< std::span< const double > > VarVector
double reduceSum(Config cfg, InputArr input, size_t n)
Architecture cpuArchitecture()
const double *__restrict InputArr
void init()
Inspect hardware capabilities, and load the optimal library for RooFit computations.
std::vector< double > ArgVector
ReduceNLLOutput reduceNLL(Config cfg, std::span< const double > probas, std::span< const double > weightSpan, std::span< const double > weights, double weightSum, std::span< const double > binVolumes)
void compute(Config cfg, Computer comp, RestrictArr output, size_t size, const VarVector &vars, ArgVector &extraArgs)
double *__restrict RestrictArr
ROOT::Math::KahanSum< double > nllSum
std::size_t nNonPositiveValues