AQUAgpusph 4.1.2
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions
Aqua::CalcServer::If Class Reference

Execute all the tools in its scope if the condition is fulfilled. More...

#include <CalcServer/Conditional.h>

Inheritance diagram for Aqua::CalcServer::If:
Inheritance graph
[legend]
Collaboration diagram for Aqua::CalcServer::If:
Collaboration graph
[legend]

Public Member Functions

 If (const std::string name, const std::string condition, bool once=false)
 Constructor.
 
 ~If ()
 Destructor.
 
void setup ()
 Initialize the tool.
 
Toolnext_tool ()
 
- Public Member Functions inherited from Aqua::CalcServer::Conditional
 Conditional (const std::string name, const std::string condition, bool once=false)
 Constructor.
 
 ~Conditional ()
 Destructor.
 
void setup ()
 Initialize the tool.
 
virtual Toolnext_tool ()
 
const int scope_modifier ()
 
- Public Member Functions inherited from Aqua::CalcServer::Tool
 Tool (const std::string tool_name, bool once=false)
 
virtual ~Tool ()
 
void name (const std::string tool_name)
 
const std::string name ()
 
virtual void setup ()
 
virtual void execute ()
 Execute the tool measuring the elapsed time.
 
virtual Toolnext_tool ()
 
size_t allocatedMemory () const
 
unsigned int used_times () const
 
float elapsedTime (bool averaged=true) const
 
float elapsedTimeVariance () const
 
float elapsedTimeDeviation () const
 
virtual const int scope_modifier ()
 

Protected Member Functions

cl_event _execute (const std::vector< cl_event > events)
 
cl_event _execute (const std::vector< cl_event > events)
 
- Protected Member Functions inherited from Aqua::CalcServer::Tool
int id_in_pipeline ()
 
void next_tool (Tool *tool)
 
void allocatedMemory (size_t mem_size)
 
virtual cl_event _execute (const std::vector< cl_event > events)
 
void addElapsedTime (float elapsed_time)
 Add new data to the average and squared elapsed times.
 
void setDependencies (std::vector< std::string > var_names)
 Set the depedencies of the tool.
 
void setDependencies (std::vector< InputOutput::Variable * > vars)
 Set the depedencies of the tool.
 
const std::vector< InputOutput::Variable * > getDependencies ()
 Get the depedencies of the tool.
 

Additional Inherited Members

- Static Protected Member Functions inherited from Aqua::CalcServer::Tool
static std::vector< cl_kernel > compile (const std::string source, const std::vector< std::string > names, const std::string flags="")
 Compile an OpenCL source code and generate the corresponding kernel.
 
static cl_kernel compile_kernel (const std::string source, const std::string kernel_name, const std::string flags="")
 Compile an OpenCL source code and generate the corresponding kernel.
 
- Protected Attributes inherited from Aqua::CalcServer::Conditional
bool _result
 Condition result.
 

Detailed Description

Execute all the tools in its scope if the condition is fulfilled.

See also
Aqua::CalcServer::Conditional

Constructor & Destructor Documentation

◆ If()

Aqua::CalcServer::If::If ( const std::string  name,
const std::string  condition,
bool  once = false 
)

Constructor.

Parameters
nameTool name.
conditionCondition to evaluate. If the result is 0, false will be considered and all the subsequent tools will be disabled until an End tool is reached.
onceRun this tool just once. Useful to make initializations.

◆ ~If()

Aqua::CalcServer::If::~If ( )

Destructor.

Member Function Documentation

◆ _execute()

cl_event Aqua::CalcServer::If::_execute ( const std::vector< cl_event >  events)
protectedvirtual

Execute the tool

Parameters
eventsList of events that shall be waited before safe execution
Returns
OpenCL event to be waited before accessing the dependencies

Reimplemented from Aqua::CalcServer::Conditional.

Here is the call graph for this function:

◆ next_tool()

Tool * Aqua::CalcServer::If::next_tool ( )
virtual

Get the next tool to be executed in the pipeline.

Such tool will be the next one if the condition is fulfilled, or the tool after the Aqua::CalcServer::End tool which closes the scope otherwise.

Since the closing Aqua::CalcServer::End tool is invariably giving back the control to this tool, the condition will be marked as unfulfilled when this tool is called, avoiding the loop execution

Returns
Next tool to be executed. NULL if no more tools shall be executed in the pipeline

Reimplemented from Aqua::CalcServer::Conditional.

Here is the call graph for this function:

◆ setup()

void Aqua::CalcServer::If::setup ( )
virtual

Initialize the tool.

Reimplemented from Aqua::CalcServer::Conditional.

Here is the call graph for this function:

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