![]() |
Peano
|
Task plugging into state transition once task becomes ready. More...
#include <LogReadyTask.h>
Public Member Functions | |
LogReadyTask (Task *task, int taskNumber, ReadyFusableTasks *taskQueue) | |
Construct log read task. | |
virtual void | run () override |
Run 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::list< Task * > &otherTasks, int targetDevice=Host) |
Fuse multiple tasks. | |
virtual std::string | toString () const |
Static Public Member Functions | |
static void | insertReadyTask (Task *task, int taskNumber, ReadyFusableTasks *taskQueue) |
Insert a new ready task into the local queues. | |
Private Attributes | |
Task * | _task |
const int | _taskNumber |
ReadyFusableTasks * | _taskQueue |
Static Private Attributes | |
static const std::string | SubmitFusedTasksStatisticsIdentifier = "tarch::multicore::taskfusion::submit-fused-tasks" |
static tarch::logging::Log | _log |
Additional Inherited Members | |
![]() | |
static constexpr int | DefaultPriority = 1024 |
static constexpr int | Host = -1 |
static constexpr int | DontFuse = -1 |
![]() | |
const int | _taskType |
int | _priority |
Task plugging into state transition once task becomes ready.
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 29 of file LogReadyTask.h.
tarch::multicore::taskfusion::LogReadyTask::LogReadyTask | ( | Task * | task, |
int | taskNumber, | ||
ReadyFusableTasks * | 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 |
Definition at line 12 of file LogReadyTask.cpp.
|
static |
Insert a new ready task into the local queues.
Is used by run() but we might also want to use it externally. Before we insert the actual task, we also remove the task's completedTaskNumbers, so noone thinks ahead of time that we are done already.
Definition at line 29 of file LogReadyTask.cpp.
References tarch::multicore::taskfusion::ReadyFusableTasks::completedTaskNumbers, tarch::multicore::taskfusion::ReadyFusableTasks::completedTasksSemaphore, tarch::multicore::taskfusion::ReadyFusableTasks::readyTasksSemaphore, and tarch::multicore::taskfusion::ReadyFusableTasks::tasks.
Referenced by tarch::multicore::taskfusion::translateFusableTaskIntoTaskSequence().
|
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. translateFusableTaskIntoTaskSequence() 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.
Definition at line 20 of file LogReadyTask.cpp.
References tarch::logging::Statistics::getInstance(), tarch::logging::Statistics::inc(), and logDebug.
|
staticprivate |
Definition at line 37 of file LogReadyTask.h.
|
private |
Definition at line 31 of file LogReadyTask.h.
|
private |
Definition at line 32 of file LogReadyTask.h.
|
private |
Definition at line 33 of file LogReadyTask.h.
|
staticprivate |
Definition at line 35 of file LogReadyTask.h.