|
Peano
|
Wrapper task around fusable tasks that is not ready yet. More...
#include <LogReadyTask.h>


Public Member Functions | |
| LogReadyTask (Task *task, TaskNumber taskNumber, FusableTasksQueue &taskQueue) | |
| Construct log read task. | |
| virtual void | run () override |
| Run task. | |
| TaskNumber | getNumber () const |
Public Member Functions inherited from tarch::multicore::Task | |
| Task (int taskType, int priority) | |
| Construct task. | |
| virtual | ~Task () |
| int | getTaskType () const |
| int | getPriority () const |
| void | setPriority (int priority) |
| Set priority. | |
| virtual bool | canFuse () const |
| virtual void | fuse (const std::vector< Task * > &otherTasks, int targetDevice=Host) |
| Fuse multiple tasks. | |
| virtual std::string | toString () const |
Static Public Attributes | |
| static constexpr TaskNumber | AdministerYourOwnTemporaryTaskLocalNumber = -3 |
Static Public Attributes inherited from tarch::multicore::Task | |
| static constexpr int | DefaultPriority = 1024 |
| static constexpr int | Host = -1 |
| static constexpr int | DontFuse = -1 |
Private Attributes | |
| Task * | _task |
| const int | _taskNumber |
| FusableTasksQueue & | _taskQueue |
| const bool | _administerYourOwnTemporaryTaskLocalNumber |
Static Private Attributes | |
| static const std::string | SubmitFusedTasksStatisticsIdentifier |
| Statistics identifier. | |
| static tarch::logging::Log | _log |
| static tarch::multicore::TaskEnumerator | _enumerator |
Additional Inherited Members | |
Protected Attributes inherited from tarch::multicore::Task | |
| const int | _taskType |
| int | _priority |
Wrapper task around fusable tasks that is not ready yet.
This task takes a fusable task and "inherits" its in-dependencies. Once it becomes ready ready, it takes its fusable task and inserts this one into the ready queue. The task therefore is a mere wrapper: It ensure that a fusable task is not inserted into the ready queue before it really becomes ready. Other than that, it does not do anything.
If the fusion is implemented lazily, the spawning of a new fusable task with in-dependencies should lead to the creation of this task. The fusable routine then has to wait before the lazy evaluation is due, so we know that the right tasks are inserted.
This task is always paired up with an instance of ProcessReadyTask. This task takes the task _task and puts it into the _taskQueue. After that, it quits, i.e. logically hands over the responsibility to ProcessReadyTask.
Definition at line 46 of file LogReadyTask.h.
| tarch::multicore::taskfusion::LogReadyTask::LogReadyTask | ( | Task * | task, |
| TaskNumber | taskNumber, | ||
| FusableTasksQueue & | taskQueue | ||
| ) |
Construct log read task.
| task | Task that is to be inserted into fusable queue as soon as this task starts to run |
| taskNumber | out dependency (no) of outgoing task |
| taskQueue | Reference to task queue |
| TaskNumber tarch::multicore::taskfusion::LogReadyTask::getNumber | ( | ) | const |
|
overridevirtual |
Run task.
If this routine is invoked, we know that all the incoming dependencies of _task are now complete. We refrain from running the task now (even though it would be valid). Instead, we lock our queue and add the task. handleFusableTask() should already have issued a follow-up task of type ProcessReadyTask. Therefore, this is all to be done here. No more work.
Implements tarch::multicore::Task.
|
private |
Definition at line 52 of file LogReadyTask.h.
|
staticprivate |
Definition at line 68 of file LogReadyTask.h.
|
staticprivate |
Definition at line 66 of file LogReadyTask.h.
|
private |
Definition at line 48 of file LogReadyTask.h.
|
private |
Definition at line 49 of file LogReadyTask.h.
|
private |
Definition at line 50 of file LogReadyTask.h.
|
staticconstexpr |
Definition at line 70 of file LogReadyTask.h.
|
staticprivate |
Statistics identifier.
This statistics identifier tells you how many tasks have actually been submitted through a LogReadyTask. If fusable tasks hit the runtime and are ready already, we insert them straight. If they are not ready yet, they are given in custody of a LogReadyTask which dumps them later. To analyse this flag, you can follow the recipe of tarch::multicore::SpawnedTasksStatisticsIdentifier.
Definition at line 64 of file LogReadyTask.h.