Files
compute-runtime/opencl/source/scheduler/scheduler_kernel.h
Krystian Chmielewski 41f3bd00ff Remove PatchTokens from KernelInfo
Use KernelDescriptor instead of patchTokens stored in KernelInfo's
patchInfo.
Removed: SPatchMediaInterfaceDescriptorLoad, SPatchAllocateLocalSurface,
SPatchMediaVFEState(slot 0), SPatchMediaVFEState(slot 1),
SPatchInterfaceDescriptorData, SPatchSamplerStateArray,
SPatchBindingTableState, SPatchDataParameterBuffer,
SPatchDataParameterStream, SPatchThreadPayload,
SPatchKernelAttributesInfo, SPatchAllocateStatelessPrivateSurface,
SPatchAllocateSyncBuffer,
SPatchAllocateStatelessConstantMemorySurfaceWithInitialization,
SPatchAllocateStatelessGlobalMemorySurfaceWithInitialization,
SPatchAllocateSystemThreadSurface.

Related-To: NEO-4729
Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
2021-03-09 17:09:13 +01:00

69 lines
1.9 KiB
C++

/*
* Copyright (C) 2017-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/built_ins/built_ins.h"
#include "opencl/source/kernel/kernel.h"
#include <algorithm>
namespace NEO {
class SchedulerKernel : public Kernel {
public:
static constexpr const char *schedulerName = "SchedulerParallel20";
friend Kernel;
~SchedulerKernel() override = default;
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() {
auto &defaultKernelInfo = getDefaultKernelInfo();
size_t crossTrheadDataSize = defaultKernelInfo.kernelDescriptor.kernelAttributes.crossThreadDataSize;
size_t dshSize = defaultKernelInfo.heapInfo.DynamicStateHeapSize;
crossTrheadDataSize = alignUp(crossTrheadDataSize, 64);
dshSize = alignUp(dshSize, 64);
return alignUp(SCHEDULER_DYNAMIC_PAYLOAD_SIZE, 64) + crossTrheadDataSize + dshSize;
}
void setArgs(GraphicsAllocation *queue,
GraphicsAllocation *commandsStack,
GraphicsAllocation *eventsPool,
GraphicsAllocation *secondaryBatchBuffer,
GraphicsAllocation *dsh,
GraphicsAllocation *reflectionSurface,
GraphicsAllocation *queueStorageBuffer,
GraphicsAllocation *ssh,
GraphicsAllocation *debugQueue = nullptr);
static BuiltinCode loadSchedulerKernel(Device *device);
protected:
SchedulerKernel(Program *programArg, const KernelInfoContainer &kernelInfosArg) : Kernel(programArg, kernelInfosArg, true) {
computeGws();
};
void computeGws();
size_t gws = 0u;
};
} // namespace NEO