|
Hedgehog
0.0.0
A library to generate hybrid pipeline workflow systems
|
Abstract Task specialized for CUDA computation. More...
#include "abstract_cuda_task.h"


Public Member Functions | |
| AbstractCUDATask (size_t numberThreads=1) | |
| Default constructor for an AbstractCUDATask. More... | |
| AbstractCUDATask (std::string_view const &name, size_t numberThreads=1) | |
| Constructor for an AbstractCUDATask with name as mandatory parameter and the number of threads as optional parameter. More... | |
| AbstractCUDATask (std::string_view const &name, size_t numberThreads, bool automaticStart, bool enablePeerAccess) | |
| Constructor for an AbstractCUDATask with name, number of threads, automaticStart and enablePeerAccess as mandatory parameter. More... | |
| void | initialize () final |
| Initialize an AbstractCUDATask to bound it to a CUDA device, and do the peer access if enabled. At the end will call AbstractCUDATask::initializeCuda. | |
| void | shutdown () final |
| Shutdown an AbstractCUDATask to destroy the task's CUDA stream created during AbstractCUDATask::initialize. First calls AbstractCUDATask::shutdownCuda. | |
| virtual void | initializeCuda () |
| Virtual initialization step, where user defined data structure can be initialized. | |
| virtual void | shutdownCuda () |
| Virtual shutdown step, where user defined data structure can be destroyed. | |
| bool | enablePeerAccess () const |
| Accessor for peer access choice. More... | |
| cudaStream_t | stream () const |
| Getter for CUDA task's stream. More... | |
| bool | hasPeerAccess (int peerDeviceId) |
| Accessor for peer access enabled for a specific device id. More... | |
Public Member Functions inherited from hh::AbstractTask< TaskOutput, TaskInputs... > | |
| 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... | |
| 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 | |
| bool | enablePeerAccess_ = false |
| Enable CUDA Peer Access through all CUDA devices available. | |
| std::unordered_set< int > | peerDeviceIds_ = {} |
| Sparse matrix of linked CUDA devices. | |
| cudaStream_t | stream_ = {} |
| CUDA stream linked to the task. | |
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. | |
Abstract Task specialized for CUDA computation.
At initialization, the device is set to the task (cudaSetDevice), and a stream is created and bound to the task (cudaStreamCreate). During shutdown, the stream is destroyed (cudaStreamDestroy).
| TaskOutput | Task output type |
| TaskInputs | Task input types |
Definition at line 78 of file abstract_cuda_task.h.
|
inlineexplicit |
Default constructor for an AbstractCUDATask.
Default constructor with as optional parameter numberThread set to 1. The default name set is "CudaTask", the task won't start automatically, and the peer access is enable.
| numberThreads | Task's number of threads |
Definition at line 92 of file abstract_cuda_task.h.

|
inlineexplicit |
Constructor for an AbstractCUDATask with name as mandatory parameter and the number of threads as optional parameter.
The task won't start automatically, and the peer access is enable.
| name | Task's name |
| numberThreads | Task's number of threads |
Definition at line 103 of file abstract_cuda_task.h.

|
inline |
Constructor for an AbstractCUDATask with name, number of threads, automaticStart and enablePeerAccess as mandatory parameter.
| name | Task's name |
| numberThreads | Task's number of threads |
| automaticStart | Task's automatic start |
| enablePeerAccess | Peer access enabling |
Definition at line 115 of file abstract_cuda_task.h.

|
inline |
Accessor for peer access choice.
Definition at line 169 of file abstract_cuda_task.h.
|
inline |
Accessor for peer access enabled for a specific device id.
| peerDeviceId | Device id to test |
Definition at line 178 of file abstract_cuda_task.h.
|
inline |
Getter for CUDA task's stream.
Definition at line 173 of file abstract_cuda_task.h.