BioDynaMo
v1.05.120-25dc9790
|
#include <operation.h>
Public Member Functions | |
Operation (const std::string &name) | |
Operation (const std::string &name, uint32_t frequency) | |
~Operation () | |
Operation * | Clone () |
void | operator() (Agent *agent) |
void | operator() () |
void | AddOperationImpl (OpComputeTarget target, OperationImpl *impl) |
template<typename T > | |
T * | GetImplementation () |
Returns the implementation corresponding to the template argument. More... | |
bool | IsComputeTargetSupported (OpComputeTarget target) |
void | SelectComputeTarget (OpComputeTarget target) |
bool | IsStandalone () |
void | SetUp () |
Forwards call to implementation's Setup function. More... | |
void | TearDown () |
Forwards call to implementation's TearDown function. More... | |
bool | IsExcluded (Functor< bool, Agent * > *filter) |
void | SetExcludeFilters (const std::set< Functor< bool, Agent * > * > &exclude_filters) |
Public Attributes | |
size_t | frequency_ = 1 |
std::string | name_ |
Operation name / unique identifier. More... | |
OpComputeTarget | active_target_ = kCpu |
The compute target that this operation will be executed on. More... | |
std::vector< OperationImpl * > | implementations_ |
The different operation implementations for each supported compute target. More... | |
std::set< Functor< bool, Agent * > * > | exclude_filters_ |
If this is an agent operation don't run it for this list of filters. More... | |
A BioDynaMo operation that is executed every frequency_
timesteps. An operation can have multiple implementations for various execution platform, or "compute targets", such as CUDA or OpenCL, to target GPU hardware for instance.
Definition at line 99 of file operation.h.
|
explicit |
Construct an operation
[in] | name | The name of the operation |
Definition at line 19 of file operation.cc.
bdm::Operation::Operation | ( | const std::string & | name, |
uint32_t | frequency | ||
) |
Construct an operation
[in] | name | The name of the operation |
[in] | frequency | The frequency at which the operation is executed |
Definition at line 21 of file operation.cc.
bdm::Operation::~Operation | ( | ) |
Definition at line 24 of file operation.cc.
void bdm::Operation::AddOperationImpl | ( | OpComputeTarget | target, |
OperationImpl * | impl | ||
) |
Add an operation implementation for the specified compute target
[in] | target | The compute target |
impl | The implementation |
Definition at line 53 of file operation.cc.
Operation * bdm::Operation::Clone | ( | ) |
Definition at line 32 of file operation.cc.
|
inline |
Returns the implementation corresponding to the template argument.
Definition at line 138 of file operation.h.
bool bdm::Operation::IsComputeTargetSupported | ( | OpComputeTarget | target | ) |
Check whether an implementation is available for the requested compute target
[in] | target | The compute target |
Definition at line 61 of file operation.cc.
Returns if this operation should be excluded for this filters Only used for agent operations.
Definition at line 178 of file operation.h.
|
inline |
Definition at line 166 of file operation.h.
void bdm::Operation::operator() | ( | ) |
Operate in a stand-alone fashion. Typically this operator is called for GPU operations, or operations that do not need to loop over simulation objects (such as updating diffusion grids)
Definition at line 51 of file operation.cc.
void bdm::Operation::operator() | ( | Agent * | agent | ) |
Operate on an individual agent. Typically this operator is called in a loop over all agents
agent | Handle to the agent |
Definition at line 47 of file operation.cc.
void bdm::Operation::SelectComputeTarget | ( | OpComputeTarget | target | ) |
Select which of the operation implementation should be used for this operation, by specifying the compute target
[in] | target | The compute target |
Definition at line 68 of file operation.cc.
|
inline |
Agent operations will not be executed for filters that are contained in exclude_filters.
Definition at line 187 of file operation.h.
void bdm::Operation::SetUp | ( | ) |
Forwards call to implementation's Setup function.
Definition at line 76 of file operation.cc.
void bdm::Operation::TearDown | ( | ) |
Forwards call to implementation's TearDown function.
Definition at line 78 of file operation.cc.
OpComputeTarget bdm::Operation::active_target_ = kCpu |
The compute target that this operation will be executed on.
Definition at line 200 of file operation.h.
If this is an agent operation don't run it for this list of filters.
Definition at line 205 of file operation.h.
size_t bdm::Operation::frequency_ = 1 |
Specifies how often this operation will be executed.
1: every timestep
2: every second timestep
...
Definition at line 196 of file operation.h.
std::vector<OperationImpl *> bdm::Operation::implementations_ |
The different operation implementations for each supported compute target.
Definition at line 202 of file operation.h.
std::string bdm::Operation::name_ |
Operation name / unique identifier.
Definition at line 198 of file operation.h.