BioDynaMo  v1.05.119-a4ff3934
Public Member Functions | Private Member Functions | Private Attributes | List of all members
bdm::ReductionOp< T > Class Template Reference

#include <reduction_op.h>

Inheritance diagram for bdm::ReductionOp< T >:
[legend]
Collaboration diagram for bdm::ReductionOp< T >:
[legend]

Public Member Functions

 ReductionOp ()
 
 ~ReductionOp () override
 
void SetUp () override
 
void Initialize (Functor< void, Agent *, T * > *agent_functor, Functor< T, const SharedData< T > & > *reduce_functor)
 
void operator() (Agent *agent) override
 
const std::vector< T > & GetResults () const
 
void TearDown () override
 
- Public Member Functions inherited from bdm::AgentOperationImpl
void operator() () override
 
bool IsStandalone () override
 Returns whether or not this operations is a stand-alone operation. More...
 
- Public Member Functions inherited from bdm::OperationImpl
virtual ~OperationImpl ()=default
 
virtual OperationImplClone ()=0
 
bool IsGpuOperation () const
 Returns whether or not this operation is supposed to run on a GPU. More...
 

Private Member Functions

 BDM_OP_HEADER (ReductionOp)
 

Private Attributes

std::vector< T > results_
 
SharedData< T > tl_results_
 
Functor< void, Agent *, T * > * agent_functor_ = nullptr
 
Functor< T, const SharedData< T > & > * reduce_functor_ = nullptr
 

Additional Inherited Members

- Public Attributes inherited from bdm::OperationImpl
OpComputeTarget target_ = kCpu
 The target that this operation implementation is supposed to run on. More...
 

Detailed Description

template<typename T>
class bdm::ReductionOp< T >

A template struct for any type of operation implementation that wishes to implement a reduction operation (e.g. counting, averaging, finding minimum and maximum values, etc.)

Definition at line 34 of file reduction_op.h.

Constructor & Destructor Documentation

◆ ReductionOp()

template<typename T >
bdm::ReductionOp< T >::ReductionOp ( )
inline

Definition at line 38 of file reduction_op.h.

◆ ~ReductionOp()

template<typename T >
bdm::ReductionOp< T >::~ReductionOp ( )
inlineoverride

Definition at line 42 of file reduction_op.h.

Member Function Documentation

◆ BDM_OP_HEADER()

template<typename T >
bdm::ReductionOp< T >::BDM_OP_HEADER ( ReductionOp< T >  )
private

◆ GetResults()

template<typename T >
const std::vector<T>& bdm::ReductionOp< T >::GetResults ( ) const
inline

Definition at line 65 of file reduction_op.h.

◆ Initialize()

template<typename T >
void bdm::ReductionOp< T >::Initialize ( Functor< void, Agent *, T * > *  agent_functor,
Functor< T, const SharedData< T > & > *  reduce_functor 
)
inline

Definition at line 53 of file reduction_op.h.

◆ operator()()

template<typename T >
void bdm::ReductionOp< T >::operator() ( Agent agent)
inlineoverridevirtual

Implements bdm::OperationImpl.

Definition at line 60 of file reduction_op.h.

◆ SetUp()

template<typename T >
void bdm::ReductionOp< T >::SetUp ( )
inlineoverridevirtual

This function is run before the operator() call. It is useful to perform tasks such as data transfer from CPU -> GPU in GPU operations

Reimplemented from bdm::OperationImpl.

Definition at line 47 of file reduction_op.h.

◆ TearDown()

template<typename T >
void bdm::ReductionOp< T >::TearDown ( )
inlineoverridevirtual

This function is run after the operator() call. It is useful to perform tasks such as data transfer from GPU -> CPU in GPU operations

Reimplemented from bdm::OperationImpl.

Definition at line 69 of file reduction_op.h.

Member Data Documentation

◆ agent_functor_

template<typename T >
Functor<void, Agent*, T*>* bdm::ReductionOp< T >::agent_functor_ = nullptr
private

Definition at line 80 of file reduction_op.h.

◆ reduce_functor_

template<typename T >
Functor<T, const SharedData<T>&>* bdm::ReductionOp< T >::reduce_functor_ = nullptr
private

Definition at line 83 of file reduction_op.h.

◆ results_

template<typename T >
std::vector<T> bdm::ReductionOp< T >::results_
private

Definition at line 75 of file reduction_op.h.

◆ tl_results_

template<typename T >
SharedData<T> bdm::ReductionOp< T >::tl_results_
private

Definition at line 77 of file reduction_op.h.


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