Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooBatchCompute::RooBatchComputeInterface Class Referenceabstract

The interface which should be implemented to provide optimised computation functions for implementations of RooAbsReal::doEval().

The class RooBatchComputeInterface provides the mechanism for external modules (like RooFit) to call functions from the library. The power lies in the virtual functions that can resolve to different implementations for the functionality; for example, calling a function through dispatchCuda will resolve to efficient CUDA implementations.

This interface contains the signatures of the compute functions of every PDF that has an optimised implementation available. These are the functions that perform the actual computations in batches.

Several implementations of this interface may be provided, e.g. SSE, AVX, AVX2 etc. At run time, the fastest implementation of this interface is selected, and using a virtual call, the computation is dispatched to the best backend.

See also
RooBatchCompute::dispatch, RooBatchComputeClass, RF_ARCH

Definition at line 176 of file RooBatchCompute.h.

Public Member Functions

virtual ~RooBatchComputeInterface ()=default
 
virtual Architecture architecture () const =0
 
virtual std::string architectureName () const =0
 
virtual void compute (Config const &cfg, Computer, std::span< double > output, VarSpan, ArgSpan)=0
 Compute the values for a batch of events.
 
virtual std::unique_ptr< AbsBufferManagercreateBufferManager () const =0
 
virtual void deleteCudaStream (CudaInterface::CudaStream *) const =0
 
virtual CudaInterface::CudaStreamnewCudaStream () const =0
 
virtual ReduceNLLOutput reduceNLL (Config const &cfg, std::span< const double > probas, std::span< const double > weights, std::span< const double > offsetProbas)=0
 
virtual double reduceSum (Config const &cfg, InputArr input, size_t n)=0
 
virtual void synchronizeCudaStream (CudaInterface::CudaStream *) const =0
 Wait until all work that was enqueued on the stream has completed.
 

#include </github/home/ROOT-CI/src/roofit/batchcompute/res/RooBatchCompute.h>

Inheritance diagram for RooBatchCompute::RooBatchComputeInterface:
[legend]

Constructor & Destructor Documentation

◆ ~RooBatchComputeInterface()

virtual RooBatchCompute::RooBatchComputeInterface::~RooBatchComputeInterface ( )
virtualdefault

Member Function Documentation

◆ architecture()

virtual Architecture RooBatchCompute::RooBatchComputeInterface::architecture ( ) const
pure virtual

◆ architectureName()

virtual std::string RooBatchCompute::RooBatchComputeInterface::architectureName ( ) const
pure virtual

◆ compute()

virtual void RooBatchCompute::RooBatchComputeInterface::compute ( Config const & cfg,
Computer ,
std::span< double > output,
VarSpan ,
ArgSpan  )
pure virtual

Compute the values for a batch of events.

The extra args (the last parameter) are read-only inputs for all computers except NormalizedPdf, which uses them as output parameters for its evaluation error counters. In the CUDA implementation, these outputs are read back from the device asynchronously: they only arrive in the caller's span with the next synchronizeCudaStream() call on the stream of the passed config. The memory backing the extra args of a NormalizedPdf call must therefore stay valid until that synchronization, so it must not live on the caller's stack.

Implemented in RooBatchCompute::RF_ARCH::RooBatchComputeClass, and RooBatchCompute::CUDA::RooBatchComputeClass.

◆ createBufferManager()

virtual std::unique_ptr< AbsBufferManager > RooBatchCompute::RooBatchComputeInterface::createBufferManager ( ) const
pure virtual

◆ deleteCudaStream()

virtual void RooBatchCompute::RooBatchComputeInterface::deleteCudaStream ( CudaInterface::CudaStream * ) const
pure virtual

◆ newCudaStream()

virtual CudaInterface::CudaStream * RooBatchCompute::RooBatchComputeInterface::newCudaStream ( ) const
pure virtual

◆ reduceNLL()

virtual ReduceNLLOutput RooBatchCompute::RooBatchComputeInterface::reduceNLL ( Config const & cfg,
std::span< const double > probas,
std::span< const double > weights,
std::span< const double > offsetProbas )
pure virtual

◆ reduceSum()

virtual double RooBatchCompute::RooBatchComputeInterface::reduceSum ( Config const & cfg,
InputArr input,
size_t n )
pure virtual

◆ synchronizeCudaStream()

virtual void RooBatchCompute::RooBatchComputeInterface::synchronizeCudaStream ( CudaInterface::CudaStream * ) const
pure virtual

Wait until all work that was enqueued on the stream has completed.

Implemented in RooBatchCompute::RF_ARCH::RooBatchComputeClass, and RooBatchCompute::CUDA::RooBatchComputeClass.


The documentation for this class was generated from the following file: