13#include <unordered_set>
18 namespace taskfusion {
Abstract super class for a job.
Represents a queue of fusable tasks.
void drainReadyTasks()
Drain all the ready tasks.
FusableTasksQueue(int type_)
tarch::timing::GlidingAverageMeasurement _probabilityThatTaskIsCompleted
ReadyTasks _readyTasks
Tasks that are ready to go.
std::pair< TaskNumber, Task * > extractFirstReadyTask(TaskNumber handlingTask)
Get first ready task.
static constexpr bool UseTryLockAndReturnTrueIfLockFailed
Can be used with the queries below if you prefer those names over the boolean values.
std::map< int, tarch::multicore::Task * > ReadyTasks
Each task in the queue is identified through a pointer to the task plus a task (dependency) number.
static constexpr int AnyTask
~FusableTasksQueue()=default
bool isTaskReadyOrRunning(int taskNumber, bool tryLock)
std::pair< TaskNumber, Task * > extractReadyTask(TaskNumber handlingTask)
TaskNumber getTaskHandlingRunningTask(TaskNumber taskNumber)
TaskNumber getFirstReadyTaskNumber()
Return number of first ready task.
std::map< int, int > RunningTasks
Map fusable task (number) onto the number of the ProcessReadyTask which actually handles them.
static constexpr bool LockQueueAndReturnReliableResult
tarch::multicore::BooleanSemaphore _readyTasksSemaphore
void updateTaskFusionProbabilities(bool triggerFusion)
Update the internal stats.
void insertReadyTask(Task *task, int taskNumber)
Insert a new ready task into the local queues.
tarch::multicore::BooleanSemaphore _statisticsSemaphore
static tarch::logging::Log _log
RunningTasks _runningTasks
Tasks that are currently running.
static const std::string SizeOfFusableTaskQueueStatisticsIdentifier
int getNumberOfReadyTasks()
Query the number of ready tasks.
Task * extractReadyTask(TaskNumber taskNumber, TaskNumber handlingTask)
Extract specific ready task.
tarch::multicore::BooleanSemaphore _runningTasksSemaphore
tarch::timing::GlidingAverageMeasurement _numberOfReadyTasksPerProcessTaskExecution
void runningTaskFinished(TaskNumber taskNumber)
FusableTasksQueue(const FusableTasksQueue &)=delete
bool isTaskReady(int taskNumber, bool tryLock)
Process set of ready tasks.
GlidingAverageMeasurement.
Have to include this header, as I need access to the SYCL_EXTERNAL keyword.