Peano
Loading...
Searching...
No Matches
taskfusion.h
Go to the documentation of this file.
1// This file is part of the Peano project. For conditions of distribution and
2// use, please see the copyright notice at www.peano-framework.org
3#pragma once
4
5
6#include <map>
7
11
12
13namespace tarch {
14 namespace multicore {
18 class Task;
19
89 namespace taskfusion {
105
122 extern const std::string MapFusedTaskOntoNativeTaskStatisticsIdentifier;
123
137 extern const std::string ProcessFusedTaskDirectlyStatisticsIdentifier;
138
139 struct FusableTasksQueue;
140
188 Task* task,
189 std::set<TaskNumber> inDependencies,
190 const TaskNumber& taskNumber
191 );
192
211
238
294 Task* task,
295 FusableTasksQueue& taskQueue,
296 std::set<TaskNumber> inDependencies,
297 const TaskNumber& taskNumber,
299 );
300
320 Task* task,
321 FusableTasksQueue& taskQueue,
322 std::set<TaskNumber> inDependencies,
323 const TaskNumber& taskNumber,
325 );
326
335 Task* task,
336 FusableTasksQueue& taskQueue,
337 std::set<TaskNumber> inDependencies,
338 const TaskNumber& taskNumber,
340 );
341
374 bool ensureHeldBackTasksAreMappedOntoNativeTasks(const std::set<TaskNumber>& taskNumbers);
375
470 bool ensureHeldBackTasksAreMappedOntoNativeTasks_LazyEvaluation(const std::set<TaskNumber>& inDependencies);
471
482 bool ensureHeldBackTasksAreMappedOntoNativeTasks_EagerConsumerTasks(const std::set<TaskNumber>& inDependencies);
483 } // namespace taskfusion
484 }
485}
Abstract super class for a job.
Definition Task.h:21
Represents a queue of fusable tasks.
void processAllReadyTasks()
Run over all known queues and invoke drainReadyTasks() on each one.
void handleFusableTask_ProducerConsumerTaskSequence(Task *task, FusableTasksQueue &taskQueue, std::set< TaskNumber > inDependencies, const TaskNumber &taskNumber, const tarch::multicore::orchestration::Strategy::FuseInstruction &fuseInstruction)
Realisation for handleFusableTask() for ProducerConsumerTaskSequence.
void handleFusableTask_LazyEvaluation(Task *task, FusableTasksQueue &taskQueue, std::set< TaskNumber > inDependencies, const TaskNumber &taskNumber, const tarch::multicore::orchestration::Strategy::FuseInstruction &fuseInstruction)
Implementation of handleFusableTask() if we use LazyEvaluation.
bool ensureHeldBackTasksAreMappedOntoNativeTasks_EagerConsumerTasks(const std::set< TaskNumber > &inDependencies)
Preamble of waitForTasks() if we use EagerEvaluation.
bool ensureHeldBackTasksAreMappedOntoNativeTasks_LazyEvaluation(const std::set< TaskNumber > &inDependencies)
Preamble of waitForTasks() and task spawns if we use LazyEvaluation.
void processAndFuseAllReadyTasks()
Drain the queues but use task fusion where possible.
const std::string DirectlyInsertFusedTaskIntoReadyQueueStatisticsIdentifier
Track how many tasks are directly inserted into ready queue.
const std::string ProcessFusedTaskDirectlyStatisticsIdentifier
Track number of tasks that are executed directly.
const std::string MapFusedTaskOntoNativeTaskStatisticsIdentifier
Track number of fused tasks that are mapped directly onto native tasks.
bool ensureHeldBackTasksAreMappedOntoNativeTasks(const std::set< TaskNumber > &taskNumbers)
Ensure that a certain set of tasks is mapped onto native tasks already.
void handleFusableTask(Task *task, std::set< TaskNumber > inDependencies, const TaskNumber &taskNumber)
Handle one fusable task.
void handleFusableTask_EagerConsumerTasks(Task *task, FusableTasksQueue &taskQueue, std::set< TaskNumber > inDependencies, const TaskNumber &taskNumber, const tarch::multicore::orchestration::Strategy::FuseInstruction &fuseInstruction)
Handle a task in the eager consumer pattern.
Have to include this header, as I need access to the SYCL_EXTERNAL keyword.
Definition accelerator.h:19