|
Hedgehog
0.0.0
A library to generate hybrid pipeline workflow systems
|
Base node for computation. More...
#include "abstract_task.h"


Public Member Functions | |
| AbstractTask () | |
| AbstractTask default constructor. More... | |
| AbstractTask (std::string_view const &name) | |
| Create a task with a custom name. More... | |
| AbstractTask (std::string_view const &name, size_t numberThreads) | |
| Create a task with a custom name and the task's cluster size. More... | |
| AbstractTask (std::string_view const &name, size_t numberThreads, bool automaticStart) | |
| Create a task with a custom name, the task's cluster size, and the automatic start. More... | |
| AbstractTask (std::string_view const name, size_t numberThreads, core::NodeType nodeType, bool automaticStart) | |
| Internal constructor needed to create nodes that derive from AbstractTask. More... | |
| AbstractTask (AbstractTask< TaskOutput, TaskInputs ... > *rhs) | |
| Copy constructor. More... | |
| virtual | ~AbstractTask ()=default |
| Default destructor. | |
| void | addResult (std::shared_ptr< TaskOutput > output) |
| Add an output data. More... | |
| std::string_view | name () |
| Task's name accessor. More... | |
| size_t | numberThreads () |
| Task's number of threads accessor. More... | |
| bool | automaticStart () |
| Task's automatic start accessor. More... | |
| core::NodeType | nodeType () |
| Task's node type accessor. More... | |
| int | deviceId () |
| Task's device ID accessor. More... | |
| int | graphId () |
| Task's graph ID accessor. More... | |
| std::shared_ptr< core::CoreNode > | core () final |
| Task's core accessor. More... | |
| std::shared_ptr< AbstractMemoryManager< TaskOutput > > const & | memoryManager () const |
| Task's memory manager accessor. More... | |
| virtual std::shared_ptr< AbstractTask< TaskOutput, TaskInputs... > > | copy () |
| Default copy overload, fail if cluster need to be copied. More... | |
| virtual void | initialize () |
| Initialize method called before AbstractTask::Execute loop. | |
| virtual void | shutdown () |
| Shutdown method called after AbstractTask::Execute loop, when AbstractTask::canTerminate evaluates to true. | |
| void | connectMemoryManager (std::shared_ptr< AbstractMemoryManager< TaskOutput >> mm) |
| Connect a memory manager to the task. More... | |
| std::shared_ptr< TaskOutput > | getManagedMemory () |
| Memory manager accessor. More... | |
| bool | canTerminate () override |
| Method called to test the task;s termination, by default, the test is: no input nodes connected and, no data waiting to be treated. More... | |
Public Member Functions inherited from hh::behavior::Node | |
| virtual std::string | extraPrintingInformation () const |
| Adds node information to print in the dot file. More... | |
Public Member Functions inherited from hh::behavior::Execute< TaskInputs > | |
| virtual void | execute (std::shared_ptr< TaskInputs >)=0 |
| Virtual declaration of execute function for a data of type Input. | |
Private Attributes | |
| std::shared_ptr< core::CoreTask< TaskOutput, TaskInputs... > > | taskCore_ = nullptr |
| Task Core. | |
| std::shared_ptr< AbstractMemoryManager< TaskOutput > > | mm_ = nullptr |
| Task's memory manager. | |
Additional Inherited Members | |
Public Types inherited from hh::behavior::MultiReceivers< TaskInputs... > | |
| using | inputs_t = std::tuple< Inputs... > |
| Tuple with the list of input types. | |
Public Types inherited from hh::behavior::Sender< TaskOutput > | |
| using | output_t = TaskOutput |
| Output Type. | |
Base node for computation.
Hedgehog Graph's node made for holding a computation kernel into their execute overload method from Execute::execute.
An AbstractTask can be bound to multiple threads, forming a cluster of tasks. The base AbstractTask will be copied n times and each of them will be bound to a thread. The AbstractTask::copy method must be overloaded to use this functionality. Also, if the AbstractTask is part of Graph that will be duplicated with an AbstractExecutionPipeline, AbstractTask::copy method needs to be overloaded.
An AbstractMemoryManager could be linked to a task through a graph (from tutorial 4, example shows Cuda memory usage):
Linking an AbstractMemoryManager requires that the AbstractTask's TaskOutput match the template type of the AbstractMemoryManager
The default order of execution is:
Only Execute::execute method need to be overloaded for every AbstractTask input types.
| TaskOutput | Output task data type. |
| TaskInputs | Inputs task data type. |
Definition at line 76 of file abstract_task.h.
|
inline |
AbstractTask default constructor.
Create a task with the name "Task", one task in the cluster (no copy overload needed), and no automatic start.
Definition at line 92 of file abstract_task.h.
|
inlineexplicit |
Create a task with a custom name.
Create a task with one task in the cluster (no copy overload needed), and no automatic start.
| name | Task name |
Definition at line 103 of file abstract_task.h.
|
inlineexplicit |
Create a task with a custom name and the task's cluster size.
| name | Task name |
| numberThreads | Task's cluster size |
Definition at line 111 of file abstract_task.h.
|
inlineexplicit |
Create a task with a custom name, the task's cluster size, and the automatic start.
| name | Task name |
| numberThreads | Task's cluster size |
| automaticStart | Task's automatic start |
Definition at line 124 of file abstract_task.h.
|
inline |
Internal constructor needed to create nodes that derive from AbstractTask.
| name | Task name |
| numberThreads | Task's cluster size |
| nodeType | Task node type |
| automaticStart | Task's automatic start |
Definition at line 136 of file abstract_task.h.
|
inlineexplicit |
|
inline |
Add an output data.
| output | Data to send to the output nodes |
Definition at line 157 of file abstract_task.h.
|
inline |
Task's automatic start accessor.
Definition at line 169 of file abstract_task.h.

|
inlineoverridevirtual |
Method called to test the task;s termination, by default, the test is: no input nodes connected and, no data waiting to be treated.
Reimplemented from hh::behavior::Node.
Definition at line 236 of file abstract_task.h.
|
inline |
Connect a memory manager to the task.
| mm | Memory manager to connect |
Definition at line 203 of file abstract_task.h.
|
inlinevirtual |
Default copy overload, fail if cluster need to be copied.
Reimplemented in hh::StateManager< StateOutput, StateInputs >.
Definition at line 193 of file abstract_task.h.

|
inlinefinalvirtual |
Task's core accessor.
Implements hh::behavior::Node.
Definition at line 185 of file abstract_task.h.

|
inline |
|
inline |
Memory manager accessor.
Definition at line 212 of file abstract_task.h.
|
inline |
|
inline |
Task's memory manager accessor.
Definition at line 189 of file abstract_task.h.

|
inline |
Task's name accessor.
Definition at line 161 of file abstract_task.h.

|
inline |
Task's node type accessor.
Definition at line 173 of file abstract_task.h.

|
inline |
Task's number of threads accessor.
Definition at line 165 of file abstract_task.h.
