2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2021-05-17 02:51:16 +08:00
|
|
|
* Copyright (C) 2018-2021 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2019-03-26 18:59:46 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-02-24 20:10:44 +08:00
|
|
|
#include "shared/source/built_ins/built_ins.h"
|
|
|
|
|
2020-02-23 05:50:57 +08:00
|
|
|
#include "opencl/source/kernel/kernel.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
#include <algorithm>
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
class SchedulerKernel : public Kernel {
|
|
|
|
public:
|
|
|
|
static constexpr const char *schedulerName = "SchedulerParallel20";
|
|
|
|
friend Kernel;
|
|
|
|
|
2019-06-19 17:22:47 +08:00
|
|
|
~SchedulerKernel() override = default;
|
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
size_t getLws() {
|
|
|
|
return PARALLEL_SCHEDULER_HWTHREADS_IN_HW_GROUP20 * PARALLEL_SCHEDULER_COMPILATION_SIZE_20;
|
|
|
|
}
|
|
|
|
|
|
|
|
size_t getGws() {
|
|
|
|
return gws;
|
|
|
|
}
|
|
|
|
|
|
|
|
void setGws(size_t newGws) {
|
|
|
|
gws = newGws;
|
|
|
|
}
|
|
|
|
|
|
|
|
size_t getCurbeSize() {
|
2021-03-22 23:26:03 +08:00
|
|
|
size_t crossThreadDataSize = kernelInfo.kernelDescriptor.kernelAttributes.crossThreadDataSize;
|
|
|
|
size_t dshSize = kernelInfo.heapInfo.DynamicStateHeapSize;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2021-03-22 23:26:03 +08:00
|
|
|
crossThreadDataSize = alignUp(crossThreadDataSize, 64);
|
2017-12-21 07:45:38 +08:00
|
|
|
dshSize = alignUp(dshSize, 64);
|
|
|
|
|
2021-03-22 23:26:03 +08:00
|
|
|
return alignUp(SCHEDULER_DYNAMIC_PAYLOAD_SIZE, 64) + crossThreadDataSize + dshSize;
|
2017-12-21 07:45:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void setArgs(GraphicsAllocation *queue,
|
|
|
|
GraphicsAllocation *commandsStack,
|
|
|
|
GraphicsAllocation *eventsPool,
|
|
|
|
GraphicsAllocation *secondaryBatchBuffer,
|
|
|
|
GraphicsAllocation *dsh,
|
|
|
|
GraphicsAllocation *reflectionSurface,
|
|
|
|
GraphicsAllocation *queueStorageBuffer,
|
|
|
|
GraphicsAllocation *ssh,
|
|
|
|
GraphicsAllocation *debugQueue = nullptr);
|
2020-02-19 23:32:00 +08:00
|
|
|
static BuiltinCode loadSchedulerKernel(Device *device);
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
protected:
|
2021-03-22 23:26:03 +08:00
|
|
|
SchedulerKernel(Program *programArg, const KernelInfo &kernelInfoArg, ClDevice &clDeviceArg) : Kernel(programArg, kernelInfoArg, clDeviceArg, true) {
|
2017-12-21 07:45:38 +08:00
|
|
|
computeGws();
|
|
|
|
};
|
|
|
|
|
|
|
|
void computeGws();
|
|
|
|
|
2020-11-12 23:31:22 +08:00
|
|
|
size_t gws = 0u;
|
2017-12-21 07:45:38 +08:00
|
|
|
};
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|