Peano
Loading...
Searching...
No Matches
Strategy.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
5namespace tarch {
6 namespace multicore {
7 namespace orchestration {
8 class Strategy;
9
10 Strategy* createDefaultStrategy();
11 } // namespace orchestration
12 } // namespace multicore
13} // namespace tarch
14
15#include <string>
16#include <utility>
17
26public:
38 enum class ExecutionPolicy {
41 };
42
44 int device;
47 FuseInstruction(int device_, int minTasks_, int maxTasks_):
48 device(device_),
49 minTasks(minTasks_),
50 maxTasks(maxTasks_) {}
51
52 std::string toString() const {
53 return "(#device=" + std::to_string(device) + ",min=" + std::to_string(minTasks)
54 + ",max=" + std::to_string(maxTasks) + ")";
55 }
56 };
57
58 virtual ~Strategy() = default;
59
63 virtual void startBSPSection(int nestedParallelismLevel) = 0;
64
68 virtual void endBSPSection(int nestedParallelismLevel) = 0;
69
70 static constexpr int EndOfBSPSection = -1;
71
155 virtual FuseInstruction fuse(int taskType) = 0;
156
182 virtual ExecutionPolicy paralleliseForkJoinSection(int nestedParallelismLevel, int numberOfTasks, int taskType) = 0;
183};
Interface for any task orchestration.
Definition Strategy.h:25
virtual FuseInstruction fuse(int taskType)=0
How many tasks shall system hold back from tasking runtime in user-defined queues.
virtual ExecutionPolicy paralleliseForkJoinSection(int nestedParallelismLevel, int numberOfTasks, int taskType)=0
Determine how to handle/realise parallelisation within fork/join region.
virtual void startBSPSection(int nestedParallelismLevel)=0
Notifies the strategy that we enter a BSP section.
virtual void endBSPSection(int nestedParallelismLevel)=0
Notifies the strategy that we leave a BSP (fork-join) section.
ExecutionPolicy
Provide hint of execution policy.
Definition Strategy.h:38
Have to include this header, as I need access to the SYCL_EXTERNAL keyword.
Definition accelerator.h:19
FuseInstruction(int device_, int minTasks_, int maxTasks_)
Definition Strategy.h:47