Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RooBatchCompute::RF_ARCH::RooBatchComputeClass Class Reference

This class overrides some RooBatchComputeInterface functions, for the purpose of providing a CPU specific implementation of the library.

Definition at line 46 of file RooBatchCompute.cxx.

Public Member Functions

 RooBatchComputeClass ()
 
Architecture architecture () const override
 
std::string architectureName () const override
 
void compute (cudaStream_t *, Computer computer, RestrictArr output, size_t nEvents, const VarVector &vars, ArgVector &extraArgs) override
 Compute multiple values using optimized functions.
 
ReduceNLLOutput reduceNLL (cudaStream_t *, RooSpan< const double > probas, RooSpan< const double > weightSpan, RooSpan< const double > weights, double weightSum, RooSpan< const double > binVolumes) override
 
double reduceSum (cudaStream_t *, InputArr input, size_t n) override
 Return the sum of an input array.
 
- Public Member Functions inherited from RooBatchCompute::RooBatchComputeInterface
virtual ~RooBatchComputeInterface ()=default
 
void compute (cudaStream_t *stream, Computer comp, RestrictArr output, size_t size, const VarVector &vars)
 
virtual float cudaEventElapsedTime (cudaEvent_t *, cudaEvent_t *)
 
virtual void cudaEventRecord (cudaEvent_t *, cudaStream_t *)
 
virtual void cudaFree (void *)
 
virtual void cudaFreeHost (void *)
 
virtual void * cudaMalloc (size_t)
 
virtual void * cudaMallocHost (size_t)
 
virtual void cudaStreamWaitEvent (cudaStream_t *, cudaEvent_t *)
 
virtual void deleteCudaEvent (cudaEvent_t *)
 
virtual void deleteCudaStream (cudaStream_t *)
 
virtual void memcpyToCPU (void *, const void *, size_t, cudaStream_t *=nullptr)
 
virtual void memcpyToCUDA (void *, const void *, size_t, cudaStream_t *=nullptr)
 
virtual cudaEvent_t * newCudaEvent (bool)
 
virtual cudaStream_t * newCudaStream ()
 
virtual bool streamIsActive (cudaStream_t *)
 

Private Attributes

const std::vector< void(*)(BatchesHandle)> _computeFunctions
 
Inheritance diagram for RooBatchCompute::RF_ARCH::RooBatchComputeClass:
[legend]

Constructor & Destructor Documentation

◆ RooBatchComputeClass()

RooBatchCompute::RF_ARCH::RooBatchComputeClass::RooBatchComputeClass ( )
inline

Definition at line 51 of file RooBatchCompute.cxx.

Member Function Documentation

◆ architecture()

Architecture RooBatchCompute::RF_ARCH::RooBatchComputeClass::architecture ( ) const
inlineoverridevirtual

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 57 of file RooBatchCompute.cxx.

◆ architectureName()

std::string RooBatchCompute::RF_ARCH::RooBatchComputeClass::architectureName ( ) const
inlineoverridevirtual

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 58 of file RooBatchCompute.cxx.

◆ compute()

void RooBatchCompute::RF_ARCH::RooBatchComputeClass::compute ( cudaStream_t *  ,
Computer  computer,
RestrictArr  output,
size_t  nEvents,
const VarVector vars,
ArgVector extraArgs 
)
inlineoverridevirtual

Compute multiple values using optimized functions.

This method creates a Batches object and passes it to the correct compute function. In case Implicit Multithreading is enabled, the events to be processed are equally divided among the tasks to be generated and computed in parallel.

Parameters
computerAn enum specifying the compute function to be used.
outputThe array where the computation results are stored.
nEventsThe number of events to be processed.
varsA std::vector containing pointers to the variables involved in the computation.
extraArgsAn optional std::vector containing extra double values that may participate in the computation.

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 81 of file RooBatchCompute.cxx.

◆ reduceNLL()

ReduceNLLOutput RooBatchCompute::RF_ARCH::RooBatchComputeClass::reduceNLL ( cudaStream_t *  ,
RooSpan< const double probas,
RooSpan< const double weightSpan,
RooSpan< const double weights,
double  weightSum,
RooSpan< const double binVolumes 
)
overridevirtual

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 175 of file RooBatchCompute.cxx.

◆ reduceSum()

double RooBatchCompute::RF_ARCH::RooBatchComputeClass::reduceSum ( cudaStream_t *  ,
InputArr  input,
size_t  n 
)
overridevirtual

Return the sum of an input array.

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 170 of file RooBatchCompute.cxx.

Member Data Documentation

◆ _computeFunctions

const std::vector<void (*)(BatchesHandle)> RooBatchCompute::RF_ARCH::RooBatchComputeClass::_computeFunctions
private

Definition at line 48 of file RooBatchCompute.cxx.

  • roofit/batchcompute/src/RooBatchCompute.cxx