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

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

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

Definition at line 90 of file RooBatchCompute.cu.

Public Member Functions

 RooBatchComputeClass ()
 
 RooBatchComputeClass ()
 
Architecture architecture () const override
 
Architecture architecture () const override
 
std::string architectureName () const override
 
std::string architectureName () const override
 
void compute (Config const &, Computer computer, std::span< double > output, VarSpan vars, ArgSpan extraArgs) override
 
void compute (RooBatchCompute::Config const &cfg, Computer computer, std::span< double > output, VarSpan vars, ArgSpan extraArgs) override
 Compute multiple values using cuda kernels.
 
std::unique_ptr< AbsBufferManagercreateBufferManager () const
 
std::unique_ptr< AbsBufferManagercreateBufferManager () const override
 
void cudaEventRecord (CudaInterface::CudaEvent *, CudaInterface::CudaStream *) const override
 
void cudaEventRecord (CudaInterface::CudaEvent *event, CudaInterface::CudaStream *stream) const override
 
bool cudaStreamIsActive (CudaInterface::CudaStream *) const override
 
bool cudaStreamIsActive (CudaInterface::CudaStream *stream) const override
 
void cudaStreamWaitForEvent (CudaInterface::CudaStream *, CudaInterface::CudaEvent *) const override
 
void cudaStreamWaitForEvent (CudaInterface::CudaStream *stream, CudaInterface::CudaEvent *event) const override
 
void deleteCudaEvent (CudaInterface::CudaEvent *) const override
 
void deleteCudaEvent (CudaInterface::CudaEvent *event) const override
 
void deleteCudaStream (CudaInterface::CudaStream *) const override
 
void deleteCudaStream (CudaInterface::CudaStream *stream) const override
 
CudaInterface::CudaEventnewCudaEvent (bool forTiming) const override
 
CudaInterface::CudaEventnewCudaEvent (bool) const override
 
CudaInterface::CudaStreamnewCudaStream () const override
 
CudaInterface::CudaStreamnewCudaStream () const override
 
ReduceNLLOutput reduceNLL (Config const &, std::span< const double > probas, std::span< const double > weights, std::span< const double > offsetProbas) override
 
ReduceNLLOutput reduceNLL (RooBatchCompute::Config const &cfg, std::span< const double > probas, std::span< const double > weights, std::span< const double > offsetProbas) override
 
double reduceSum (Config const &, InputArr input, size_t n) override
 
double reduceSum (RooBatchCompute::Config const &cfg, InputArr input, size_t n) override
 Return the sum of an input array.
 
- Public Member Functions inherited from RooBatchCompute::RooBatchComputeInterface
virtual ~RooBatchComputeInterface ()=default
 

Private Attributes

const std::vector< void(*)(Batches &)> _computeFunctions
 
Inheritance diagram for RooBatchCompute::CUDA::RooBatchComputeClass:
[legend]

Constructor & Destructor Documentation

◆ RooBatchComputeClass() [1/2]

RooBatchCompute::CUDA::RooBatchComputeClass::RooBatchComputeClass ( )
inline

Definition at line 93 of file RooBatchCompute.cu.

◆ RooBatchComputeClass() [2/2]

RooBatchCompute::CUDA::RooBatchComputeClass::RooBatchComputeClass ( )
inline

Definition at line 86 of file RooBatchCompute.cxx.

Member Function Documentation

◆ architecture() [1/2]

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

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 98 of file RooBatchCompute.cu.

◆ architecture() [2/2]

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

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 92 of file RooBatchCompute.cxx.

◆ architectureName() [1/2]

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

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 99 of file RooBatchCompute.cu.

◆ architectureName() [2/2]

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

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 93 of file RooBatchCompute.cxx.

◆ compute() [1/2]

void RooBatchCompute::CUDA::RooBatchComputeClass::compute ( Config const &  ,
Computer  computer,
std::span< double output,
VarSpan  vars,
ArgSpan  extraArgs 
)
overridevirtual

◆ compute() [2/2]

void RooBatchCompute::CUDA::RooBatchComputeClass::compute ( RooBatchCompute::Config const &  cfg,
Computer  computer,
std::span< double output,
VarSpan  vars,
ArgSpan  extraArgs 
)
inlineoverridevirtual

Compute multiple values using cuda kernels.

Compute multiple values using optimized functions.

This method creates a Batches object and passes it to the correct compute function. The compute function is launched as a cuda kernel.

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

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.
varsA std::span containing pointers to the variables involved in the computation.
extraArgsAn optional std::span containing extra double values that may participate in the computation.

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 108 of file RooBatchCompute.cu.

◆ createBufferManager() [1/2]

std::unique_ptr< AbsBufferManager > RooBatchCompute::CUDA::RooBatchComputeClass::createBufferManager ( ) const
virtual

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 548 of file RooBatchCompute.cu.

◆ createBufferManager() [2/2]

std::unique_ptr< AbsBufferManager > RooBatchCompute::CUDA::RooBatchComputeClass::createBufferManager ( ) const
overridevirtual

◆ cudaEventRecord() [1/2]

void RooBatchCompute::CUDA::RooBatchComputeClass::cudaEventRecord ( CudaInterface::CudaEvent ,
CudaInterface::CudaStream  
) const
inlineoverridevirtual

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 117 of file RooBatchCompute.cxx.

◆ cudaEventRecord() [2/2]

void RooBatchCompute::CUDA::RooBatchComputeClass::cudaEventRecord ( CudaInterface::CudaEvent event,
CudaInterface::CudaStream stream 
) const
inlineoverridevirtual

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 166 of file RooBatchCompute.cu.

◆ cudaStreamIsActive() [1/2]

bool RooBatchCompute::CUDA::RooBatchComputeClass::cudaStreamIsActive ( CudaInterface::CudaStream ) const
inlineoverridevirtual

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 125 of file RooBatchCompute.cxx.

◆ cudaStreamIsActive() [2/2]

bool RooBatchCompute::CUDA::RooBatchComputeClass::cudaStreamIsActive ( CudaInterface::CudaStream stream) const
inlineoverridevirtual

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 174 of file RooBatchCompute.cu.

◆ cudaStreamWaitForEvent() [1/2]

void RooBatchCompute::CUDA::RooBatchComputeClass::cudaStreamWaitForEvent ( CudaInterface::CudaStream ,
CudaInterface::CudaEvent  
) const
inlineoverridevirtual

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 121 of file RooBatchCompute.cxx.

◆ cudaStreamWaitForEvent() [2/2]

void RooBatchCompute::CUDA::RooBatchComputeClass::cudaStreamWaitForEvent ( CudaInterface::CudaStream stream,
CudaInterface::CudaEvent event 
) const
inlineoverridevirtual

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 170 of file RooBatchCompute.cu.

◆ deleteCudaEvent() [1/2]

void RooBatchCompute::CUDA::RooBatchComputeClass::deleteCudaEvent ( CudaInterface::CudaEvent ) const
inlineoverridevirtual

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 115 of file RooBatchCompute.cxx.

◆ deleteCudaEvent() [2/2]

void RooBatchCompute::CUDA::RooBatchComputeClass::deleteCudaEvent ( CudaInterface::CudaEvent event) const
inlineoverridevirtual

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 163 of file RooBatchCompute.cu.

◆ deleteCudaStream() [1/2]

void RooBatchCompute::CUDA::RooBatchComputeClass::deleteCudaStream ( CudaInterface::CudaStream ) const
inlineoverridevirtual

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 116 of file RooBatchCompute.cxx.

◆ deleteCudaStream() [2/2]

void RooBatchCompute::CUDA::RooBatchComputeClass::deleteCudaStream ( CudaInterface::CudaStream stream) const
inlineoverridevirtual

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 164 of file RooBatchCompute.cu.

◆ newCudaEvent() [1/2]

CudaInterface::CudaEvent * RooBatchCompute::CUDA::RooBatchComputeClass::newCudaEvent ( bool  forTiming) const
inlineoverridevirtual

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 158 of file RooBatchCompute.cu.

◆ newCudaEvent() [2/2]

CudaInterface::CudaEvent * RooBatchCompute::CUDA::RooBatchComputeClass::newCudaEvent ( bool  ) const
inlineoverridevirtual

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 113 of file RooBatchCompute.cxx.

◆ newCudaStream() [1/2]

CudaInterface::CudaStream * RooBatchCompute::CUDA::RooBatchComputeClass::newCudaStream ( ) const
inlineoverridevirtual

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 162 of file RooBatchCompute.cu.

◆ newCudaStream() [2/2]

CudaInterface::CudaStream * RooBatchCompute::CUDA::RooBatchComputeClass::newCudaStream ( ) const
inlineoverridevirtual

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 114 of file RooBatchCompute.cxx.

◆ reduceNLL() [1/2]

ReduceNLLOutput RooBatchCompute::CUDA::RooBatchComputeClass::reduceNLL ( Config const &  ,
std::span< const double probas,
std::span< const double weights,
std::span< const double offsetProbas 
)
overridevirtual

◆ reduceNLL() [2/2]

ReduceNLLOutput RooBatchCompute::CUDA::RooBatchComputeClass::reduceNLL ( RooBatchCompute::Config const &  cfg,
std::span< const double probas,
std::span< const double weights,
std::span< const double offsetProbas 
)
overridevirtual

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 291 of file RooBatchCompute.cu.

◆ reduceSum() [1/2]

double RooBatchCompute::CUDA::RooBatchComputeClass::reduceSum ( Config const &  ,
InputArr  input,
size_t  n 
)
overridevirtual

◆ reduceSum() [2/2]

double RooBatchCompute::CUDA::RooBatchComputeClass::reduceSum ( RooBatchCompute::Config const &  cfg,
InputArr  input,
size_t  n 
)
overridevirtual

Return the sum of an input array.

Implements RooBatchCompute::RooBatchComputeInterface.

Definition at line 276 of file RooBatchCompute.cu.

Member Data Documentation

◆ _computeFunctions

const std::vector< void(*)(Batches &)> RooBatchCompute::CUDA::RooBatchComputeClass::_computeFunctions
private

Definition at line 177 of file RooBatchCompute.cu.

  • roofit/batchcompute/src/RooBatchCompute.cu
  • roofit/batchcompute/src/RooBatchCompute.cxx