AQUAgpusph 5.0.4
|
A generic variable. Almost useless, use the overloaded classes instead of this one. More...
#include <Variable.hpp>
Public Member Functions | |
Variable (const std::string varname, const std::string vartype) | |
Constructor. | |
virtual | ~Variable () |
Destructor. | |
virtual bool | isArray ()=0 |
Let efficiently know whether the variable is an array or not. | |
bool | isScalar () |
Let efficiently know whether the variable is a scalar or not. | |
std::string | name () const |
Name of the variable. | |
virtual std::string | type () const |
Type of the variable. | |
virtual size_t | typesize () const |
Get the variable type size. | |
virtual size_t | size () const |
Get the variable type size. | |
virtual void * | get (bool UNUSED_PARAM synced=true) |
Get variable pointer basis pointer. | |
void * | get_async () |
Get variable pointer basis pointer. | |
virtual void | set (void *ptr, bool synced=true) |
Set variable from memory. | |
void | set_async (void *ptr) |
Set variable from memory. | |
virtual PyObject * | getPythonObject (int UNUSED_PARAM i0=0, int UNUSED_PARAM n=0) |
Get a Python interpretation of the variable. | |
virtual bool | setFromPythonObject (PyObject UNUSED_PARAM *obj, int UNUSED_PARAM i0=0, int UNUSED_PARAM n=0) |
Set the variable from a Python object. | |
virtual const std::string | asString (bool UNUSED_PARAM synced=true) |
Get the variable text representation. | |
void | setEvent (cl_event event) |
Set the variable current writing event. | |
void | setWritingEvent (cl_event event) |
Alias of InputOutput::Variable::setEvent() | |
cl_event | getEvent () const |
Returns the last writing event associated to this variable. | |
cl_event | getWritingEvent () const |
Alias of InputOutput::Variable::getEvent() | |
void | addReadingEvent (cl_event event) |
Add a new reading event to the variable. | |
std::vector< cl_event > | getReadingEvents () const |
Get the list of reading events. | |
void | sync (bool readonly=false) |
Wait for variable reading and writing events to be completed. |
Protected Member Functions | |
void | cleanReadingEvents () |
Clean up the list of reading events. |
Static Protected Member Functions | |
static cl_event | createDummyEvent () |
Create a competed user event to be set as the writing event when synced writing operations are carried out. |
A generic variable. Almost useless, use the overloaded classes instead of this one.
Constructor.
varname | Name of the variable. |
vartype | Type of the variable. |
|
virtual |
Destructor.
|
inlinevirtual |
Get the variable text representation.
|
staticprotected |
Create a competed user event to be set as the writing event when synced writing operations are carried out.
std::runtime_error | If the OpenCL event creation fails |
|
inlinevirtual |
Get variable pointer basis pointer.
synced | true if the operation shall block the execution until the variable events are dispatched |
Reimplemented in Aqua::InputOutput::ArrayVariable.
|
inline |
Get variable pointer basis pointer.
Sometimes a tool would make events micromanagement, becoming useful to can retrieve the value in an asynchronous way. That is for instance the case of events manipulated in callbacks
|
inlinevirtual |
Get a Python interpretation of the variable.
i0 | First component to be read, just for array variables. |
n | Number of component to be read, just for array variables. |
|
pure virtual |
Let efficiently know whether the variable is an array or not.
Implemented in Aqua::InputOutput::ArrayVariable, Aqua::InputOutput::ScalarVariable< T >, Aqua::InputOutput::ScalarVariable< dcl >, Aqua::InputOutput::ScalarVariable< fcl >, Aqua::InputOutput::ScalarVariable< icl >, Aqua::InputOutput::ScalarVariable< lcl >, Aqua::InputOutput::ScalarVariable< uicl >, and Aqua::InputOutput::ScalarVariable< ulcl >.
|
inline |
Let efficiently know whether the variable is a scalar or not.
|
inline |
Name of the variable.
|
virtual |
Set variable from memory.
If synced
, this method is setting a completed user event as the variable writing event. Remeber to call this at the end of any overloaded function
ptr | Unused parameter, it is of use for overloaded functions |
synced | true if the operation shall block the execution until the variable events are dispatched |
Reimplemented in Aqua::InputOutput::ArrayVariable, Aqua::InputOutput::ScalarVariable< T >, Aqua::InputOutput::ScalarVariable< dcl >, Aqua::InputOutput::ScalarVariable< fcl >, Aqua::InputOutput::ScalarVariable< icl >, Aqua::InputOutput::ScalarVariable< lcl >, Aqua::InputOutput::ScalarVariable< uicl >, and Aqua::InputOutput::ScalarVariable< ulcl >.
|
inline |
Set variable from memory.
Sometimes a tool would make events micromanagement, becoming useful to can retrieve the value in an asynchronous way. That is for instance the case of events manipulated in callbacks
ptr | Memory to copy |
|
inlinevirtual |
Set the variable from a Python object.
obj | Python object. |
i0 | First component to be set, just for array variables. |
n | Number of component to be set, just for array variables. |
|
inlinevirtual |
Get the variable type size.
Reimplemented in Aqua::InputOutput::ArrayVariable.
|
inlinevirtual |
Type of the variable.
|
inlinevirtual |
Get the variable type size.
Reimplemented in Aqua::InputOutput::ArrayVariable, Aqua::InputOutput::ScalarVariable< T >, Aqua::InputOutput::ScalarVariable< dcl >, Aqua::InputOutput::ScalarVariable< fcl >, Aqua::InputOutput::ScalarVariable< icl >, Aqua::InputOutput::ScalarVariable< lcl >, Aqua::InputOutput::ScalarVariable< uicl >, and Aqua::InputOutput::ScalarVariable< ulcl >.