Add resolves for stateless compression with shared buffer

Related-To: NEO-5107

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
This commit is contained in:
Milczarek, Slawomir
2021-09-16 23:23:37 +00:00
committed by Compute-Runtime-Automation
parent c73f10c2be
commit 0a8b473f3c
4 changed files with 57 additions and 1 deletions

View File

@@ -2530,6 +2530,19 @@ void Kernel::fillWithKernelObjsForAuxTranslation(KernelObjsForAuxTranslation &ke
}
}
bool Kernel::hasDirectStatelessAccessToSharedBuffer() const {
for (uint32_t i = 0; i < getKernelArgsNumber(); i++) {
const auto &arg = kernelInfo.kernelDescriptor.payloadMappings.explicitArgs[i];
if (BUFFER_OBJ == kernelArguments.at(i).type && !arg.as<ArgDescPointer>().isPureStateful()) {
auto buffer = castToObject<Buffer>(getKernelArg(i));
if (buffer && buffer->getMultiGraphicsAllocation().getAllocationType() == GraphicsAllocation::AllocationType::SHARED_BUFFER) {
return true;
}
}
}
return false;
}
bool Kernel::hasDirectStatelessAccessToHostMemory() const {
for (uint32_t i = 0; i < getKernelArgsNumber(); i++) {
const auto &arg = kernelInfo.kernelDescriptor.payloadMappings.explicitArgs[i];
@@ -2848,7 +2861,9 @@ bool Kernel::requiresLimitedWorkgroupSize() const {
void Kernel::updateAuxTranslationRequired() {
const auto &hwInfoConfig = *HwInfoConfig::get(getDevice().getHardwareInfo().platform.eProductFamily);
if (hwInfoConfig.allowStatelessCompression(getDevice().getHardwareInfo())) {
if (hasDirectStatelessAccessToHostMemory() || hasIndirectStatelessAccessToHostMemory()) {
if (hasDirectStatelessAccessToHostMemory() ||
hasIndirectStatelessAccessToHostMemory() ||
hasDirectStatelessAccessToSharedBuffer()) {
setAuxTranslationRequired(true);
}
}

View File

@@ -514,6 +514,7 @@ class Kernel : public ReferenceTrackedObject<Kernel> {
void resolveArgs();
void reconfigureKernel();
bool hasDirectStatelessAccessToSharedBuffer() const;
bool hasDirectStatelessAccessToHostMemory() const;
bool hasIndirectStatelessAccessToHostMemory() const;