Files
compute-runtime/opencl/source/helpers/dispatch_info.cpp
Mateusz Jablonski a697a3f718 refactor: create new members for storing spill and private memory in scratch
rename private scratch space into scratch space slot 1 as it can be generic

Related-To: NEO-9944
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2024-01-23 12:42:25 +01:00

50 lines
1.3 KiB
C++

/*
* Copyright (C) 2018-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "opencl/source/helpers/dispatch_info.h"
#include "opencl/source/kernel/kernel.h"
#include "opencl/source/mem_obj/mem_obj.h"
namespace NEO {
bool DispatchInfo::usesSlm() const {
return (kernel == nullptr) ? false : kernel->getSlmTotalSize() > 0;
}
bool DispatchInfo::usesStatelessPrintfSurface() const {
return (kernel == nullptr) ? false : kernel->hasPrintfOutput();
}
uint32_t DispatchInfo::getRequiredScratchSize(uint32_t slotId) const {
return (kernel == nullptr) ? 0 : kernel->getScratchSize(slotId);
}
MultiDispatchInfo::~MultiDispatchInfo() {
for (MemObj *redescribedSurface : redescribedSurfaces) {
redescribedSurface->release();
}
}
void MultiDispatchInfo::pushRedescribedMemObj(std::unique_ptr<MemObj> memObj) {
redescribedSurfaces.push_back(memObj.release());
}
Kernel *MultiDispatchInfo::peekMainKernel() const {
if (dispatchInfos.size() == 0) {
return nullptr;
}
return mainKernel ? mainKernel : dispatchInfos.begin()->getKernel();
}
void MultiDispatchInfo::backupUnifiedMemorySyncRequirement() {
for (const auto &dispatchInfo : dispatchInfos) {
dispatchInfo.getKernel()->setUnifiedMemorySyncRequirement(true);
}
}
} // namespace NEO