Peano
Loading...
Searching...
No Matches
AllOnGPU.cpp
Go to the documentation of this file.
1#include "AllOnGPU.h"
2
5
6#include <limits>
7
9 _device(device),
10 _deviceToUse(device==RoundRobin ? 0 : _device),
11 _isInBspSection(false) {}
12
14 if (nestedParallelismLevel <= 1) {
15 _isInBspSection = true;
16 }
17}
18
20 if (nestedParallelismLevel <= 1) {
21 _isInBspSection = false;
22 }
23}
24
26 if (_device==RoundRobin) toggleDevice();
27 return FuseInstruction(_deviceToUse, 1, std::numeric_limits<int>::max());
28}
29
30
32 int nestedParallelismLevel,
33 int /*numberOfTasks*/,
34 int /*codeLocationIdentifier*/
35) {
36 if (nestedParallelismLevel <= 1) {
38 } else {
40 }
41}
42
43
45 if (tarch::accelerator::Device::getInstance().getNumberOfDevices() == 0) {
46 _deviceToUse = Task::Host;
47 } else {
48 _deviceToUse++;
49 _deviceToUse = _deviceToUse % tarch::accelerator::Device::getInstance().getNumberOfDevices();
50 }
51}
52
53
55 int taskType,
56 int queueSize,
57 double averageNumberOfPendingReadyTasksPerProcessTaskExecution
58) {
59 // empty on purpose
60}
static Device & getInstance()
int getNumberOfDevices() const
Return the number of GPUs that are available.
static constexpr int Host
Definition Task.h:28
AllOnGPU(int device)
Initialise strategy.
Definition AllOnGPU.cpp:8
virtual void startBSPSection(int nestedParallelismLevel) override
Notifies the strategy that we enter a BSP section.
Definition AllOnGPU.cpp:13
virtual void updateFuseStatistics(int taskType, int queueSize, double averageNumberOfPendingReadyTasksPerProcessTaskExecution) override
Definition AllOnGPU.cpp:54
virtual ExecutionPolicy paralleliseForkJoinSection(int nestedParallelismLevel, int numberOfTasks, int taskType) override
No if we encounter nested parallelism.
Definition AllOnGPU.cpp:31
virtual FuseInstruction fuse(int taskType) override
Return how many tasks to fuse at least, at most and to which device to deploy them.
Definition AllOnGPU.cpp:25
virtual void endBSPSection(int nestedParallelismLevel) override
Notifies the strategy that we leave a BSP (fork-join) section.
Definition AllOnGPU.cpp:19
ExecutionPolicy
Provide hint of execution policy.
Definition Strategy.h:41