AQUAgpusph 5.0.4
Loading...
Searching...
No Matches
Aqua::CalcServer::Reports::Report Class Reference

Runtime outputs base class. More...

#include <Report.hpp>

Inheritance diagram for Aqua::CalcServer::Reports::Report:
Collaboration diagram for Aqua::CalcServer::Reports::Report:

Public Member Functions

 Report (const std::string tool_name, const std::string fields, unsigned int ipf=1, float fps=0.f)
 Constructor.
virtual ~Report ()
 Destructor.
virtual void setup ()
 Initialize the tool.
const std::string data (bool with_title=true, bool with_names=true, bool synced=false)
 Return the text string of the data to be printed.
cl_event getUserEvent () const
 Get the user event generated by this tool to mark when is finished.
void setUserEventStatus (cl_int status) const
 Set the user event status.
Public Member Functions inherited from Aqua::CalcServer::Tool
 Tool (const std::string tool_name, bool once=false)
virtual ~Tool ()
virtual void execute ()
 Execute the tool measuring the elapsed time.
virtual Toolnext_tool ()
Toolprev_tool () const
void prev_tool (Tool *tool)
size_t allocatedMemory () const
unsigned int used_times () const
void addElapsedTime (float elapsed_time)
 Add new data to the average and squared elapsed times.
float elapsedTime (bool averaged=true) const
float elapsedTimeVariance () const
float elapsedTimeDeviation () const
virtual int scope_modifier () const
std::vector< InputOutput::Variable * > getInputDependencies () const
 Get the input depedencies of the tool.
std::vector< InputOutput::Variable * > getOutputDependencies () const
 Get the output depedencies of the tool.
std::tuple< std::vector< InputOutput::Variable * >, std::vector< InputOutput::Variable * > > getDependencies () const
 Get the depedencies of the tool.
cl_event getEvent () const
 Get the tool event.
void parent (Tool *tool)
 Set the tool parent.
Toolparent ()
 Get the tool parent.
Public Member Functions inherited from Aqua::CalcServer::Named
 Named (const std::string name)
 ~Named ()
void name (const std::string tool_name)
const std::string name () const
 Get the name.
Public Member Functions inherited from Aqua::CalcServer::Profiler
 Profiler ()
 ~Profiler ()
std::vector< Profile * > substages () const
 Get the substages.

Protected Member Functions

void processFields (const std::string fields)
 Compute the fields by lines.
std::vector< InputOutput::Variable * > variables ()
 Get the variables list.
bool mustUpdate ()
 Check if an output must be performed.
cl_event setCallback (const std::vector< cl_event > events, void(CL_CALLBACK *cb)(cl_event, cl_int, void *))
 Register a callback to be executed whenever it is possible.
Protected Member Functions inherited from Aqua::CalcServer::Tool
int id_in_pipeline () const
std::string varPrefix () const
 Produce a variable name prefix.
void next_tool (Tool *tool)
void allocatedMemory (size_t mem_size)
virtual cl_event _execute (const UNUSED_PARAM std::vector< cl_event > events)
void setDependencies (std::vector< std::string > inputs, std::vector< std::string > outputs)
 Set the depedencies of the tool.
void setDependencies (std::vector< InputOutput::Variable * > inputs, std::vector< InputOutput::Variable * > outputs)
 Set the depedencies of the tool.
void setDependencies (std::vector< std::string > vars)
 Set the depedencies of the tool.
void setInputDependencies (std::vector< std::string > vars)
 Set the reading depedencies of the tool.
void setInputDependencies (std::vector< InputOutput::Variable * > vars)
 Set the reading depedencies of the tool.
void setOutputDependencies (std::vector< std::string > vars)
 Set the writing depedencies of the tool.
void setOutputDependencies (std::vector< InputOutput::Variable * > vars)
 Set the writing depedencies of the tool.
void setDependencies (std::vector< InputOutput::Variable * > vars)
 Set the depedencies of the tool.
const std::vector< cl_event > getEvents (dep_events which=dep_events::all) const
 Get the list of events that this tool shall wait for.
Protected Member Functions inherited from Aqua::CalcServer::Profiler
void substages (std::vector< Profile * > instances)
 Set the tool substages.

Additional Inherited Members

Protected Types inherited from Aqua::CalcServer::Tool
enum  dep_events { in = 0x01 , out = 0x02 , all = 0x03 }
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.

Detailed Description

Runtime outputs base class.

A runtime output is an output value that:

  1. Is composed by a relatively low amount of memory
  2. Its computation is not taking too much time Therefore it could be computed and printed oftenly.

It is tipically applied to print some relevant screen information or plot friendly tabulated files.

Constructor & Destructor Documentation

◆ Report()

Aqua::CalcServer::Reports::Report::Report ( const std::string tool_name,
const std::string fields,
unsigned int ipf = 1,
float fps = 0.f )

Constructor.

Parameters
tool_nameTool name.
fieldsFields to be printed. The fields are separated by commas or semicolons, and the spaces are just ignored.
ipfIterations per frame, 0 to just ignore this printing criteria.
fpsFrames per second, 0 to just ignore this printing criteria.
Here is the call graph for this function:

◆ ~Report()

Aqua::CalcServer::Reports::Report::~Report ( )
virtual

Destructor.

Member Function Documentation

◆ data()

const std::string Aqua::CalcServer::Reports::Report::data ( bool with_title = true,
bool with_names = true,
bool synced = false )

Return the text string of the data to be printed.

Parameters
with_titletrue if the report title should be inserted, false otherwise.
with_namestrue if the variable names should be printed, false otherwise.
syncedtrue if the function shall block until the variables writing events are dispatched, false otherwise
Returns
Text string to be printed either in a file or in the screen.
Here is the call graph for this function:

◆ getUserEvent()

cl_event Aqua::CalcServer::Reports::Report::getUserEvent ( ) const
inline

Get the user event generated by this tool to mark when is finished.

Returns
The event
Note
This event will be the same than Aqua::CalcServer::Tool::getEvent(), however we need it just in case the callback is executed before Aqua::CalcServer::Tool had time to store it (race condition)

◆ mustUpdate()

bool Aqua::CalcServer::Reports::Report::mustUpdate ( )
protected

Check if an output must be performed.

If the answer is true, the tool will set the time instant as the last printing event

Returns
true if a report should be printed, false otherwise.
Here is the call graph for this function:

◆ processFields()

void Aqua::CalcServer::Reports::Report::processFields ( const std::string fields)
protected

Compute the fields by lines.

Here is the call graph for this function:

◆ setCallback()

cl_event Aqua::CalcServer::Reports::Report::setCallback ( const std::vector< cl_event > events,
void(CL_CALLBACK *cb)(cl_event, cl_int, void *)  )
protected

Register a callback to be executed whenever it is possible.

Parameters
eventsEvents to be waited for. If an empty list is provided, the callback is waiting until all previous enqueued commands (on the current command queue) are finished.
cbCallback to be called.
Returns
The user event to be set as complete by the callback
Note
The callback is responsible of setting the user event as CL_COMPLETE.
The callback is responsible of calling clReleaseEvent() on the user event
Here is the call graph for this function:

◆ setup()

void Aqua::CalcServer::Reports::Report::setup ( )
virtual

◆ setUserEventStatus()

void Aqua::CalcServer::Reports::Report::setUserEventStatus ( cl_int status) const
inline

Set the user event status.

Parameters
statusEither CL_COMPLETE or a negative integer
Exceptions
std::runtime_errorif an OpenCL error is detected
Warning
After calling this function, the event eventually got with getUserEvent() is not valid anymore
Here is the call graph for this function:

◆ variables()

std::vector< InputOutput::Variable * > Aqua::CalcServer::Reports::Report::variables ( )
inlineprotected

Get the variables list.

Returns
The variables list resulting from _fields

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