Simplify HardwareCommandsHelper

Related-To: NEO-4175

Change-Id: I39b08353514ea0bf384b6b592f24952d0ed631e6
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2020-01-23 15:52:49 +01:00
committed by sys_ocldev
parent fd8c5ba67f
commit 60c7587c2b
21 changed files with 185 additions and 109 deletions

View File

@@ -776,11 +776,7 @@ void Kernel::setStartOffset(uint32_t offset) {
this->startOffset = offset;
}
const void *Kernel::getSurfaceStateHeap() const {
return kernelInfo.usesSsh ? pSshLocal.get() : nullptr;
}
void *Kernel::getSurfaceStateHeap() {
void *Kernel::getSurfaceStateHeap() const {
return kernelInfo.usesSsh ? pSshLocal.get() : nullptr;
}
@@ -2405,4 +2401,31 @@ bool Kernel::checkIfIsParentKernelAndBlocksUsesPrintf() {
return isParentKernel && getProgram()->getBlockKernelManager()->getIfBlockUsesPrintf();
}
uint64_t Kernel::getKernelStartOffset(
const bool localIdsGenerationByRuntime,
const bool kernelUsesLocalIds,
const bool isCssUsed) const {
uint64_t kernelStartOffset = 0;
if (kernelInfo.getGraphicsAllocation()) {
kernelStartOffset = kernelInfo.getGraphicsAllocation()->getGpuAddressToPatch();
if (localIdsGenerationByRuntime == false && kernelUsesLocalIds == true) {
DEBUG_BREAK_IF(kernelInfo.patchInfo.threadPayload->OffsetToSkipPerThreadDataLoad != 128);
kernelStartOffset += kernelInfo.patchInfo.threadPayload->OffsetToSkipPerThreadDataLoad;
}
}
kernelStartOffset += getStartOffset();
auto &hardwareInfo = getDevice().getHardwareInfo();
auto &hwHelper = HwHelper::get(hardwareInfo.platform.eRenderCoreFamily);
if (isCssUsed && hwHelper.isOffsetToSkipSetFFIDGPWARequired(hardwareInfo)) {
kernelStartOffset += kernelInfo.patchInfo.threadPayload->OffsetToSkipSetFFIDGP;
}
return kernelStartOffset;
}
} // namespace NEO

View File

@@ -147,8 +147,7 @@ class Kernel : public BaseObject<_cl_kernel> {
size_t *paramValueSizeRet) const;
const void *getKernelHeap() const;
const void *getSurfaceStateHeap() const;
void *getSurfaceStateHeap();
void *getSurfaceStateHeap() const;
const void *getDynamicStateHeap() const;
size_t getKernelHeapSize() const;
@@ -404,6 +403,11 @@ class Kernel : public BaseObject<_cl_kernel> {
size_t *localWorkSize);
uint32_t getMaxWorkGroupCount(const cl_uint workDim, const size_t *localWorkSize) const;
uint64_t getKernelStartOffset(
const bool localIdsGenerationByRuntime,
const bool kernelUsesLocalIds,
const bool isCssUsed) const;
protected:
struct ObjectCounts {
uint32_t imageCount;