Files
compute-runtime/shared/source/program/program_info.cpp
Kacper Nowak 2285772c7e Disable zebin on pre-Gen12 platforms when debugger is active
On pre-Gen12 platform we use igfxdcd kernel module for debugging, which
does not support zebinary format.
- When platform is pre-Gen12 an and debugger is
attached, if binary format is zebin and it's not a builtin:
- If SPIR-V is available - force rebuild with zebin disabled
- Otherwise, return an error.
- Minor refactor: extend check for ir presence for each case of
rebuilt in OCL.

Related-To: NEO-7328
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
2022-10-13 17:27:48 +02:00

55 lines
1.6 KiB
C++

/*
* Copyright (C) 2020-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/program/program_info.h"
#include "shared/source/device/device.h"
#include "shared/source/program/kernel_info.h"
namespace NEO {
ProgramInfo::~ProgramInfo() {
for (auto &kernelInfo : kernelInfos) {
delete kernelInfo;
}
kernelInfos.clear();
}
size_t getMaxInlineSlmNeeded(const ProgramInfo &programInfo) {
uint32_t ret = 0U;
for (const auto &kernelInfo : programInfo.kernelInfos) {
ret = std::max(ret, kernelInfo->kernelDescriptor.kernelAttributes.slmInlineSize);
}
return ret;
}
bool requiresLocalMemoryWindowVA(const ProgramInfo &programInfo) {
for (const auto &kernelInfo : programInfo.kernelInfos) {
if (isValidOffset(kernelInfo->kernelDescriptor.payloadMappings.implicitArgs.localMemoryStatelessWindowStartAddres)) {
return true;
}
}
return false;
}
bool isRebuiltToPatchtokensRequired(Device *neoDevice, ArrayRef<const uint8_t> archive, std::string &optionsString, bool isBuiltin) {
if (isBuiltin) {
return false;
}
auto isSourceLevelDebuggerActive = (nullptr != neoDevice->getSourceLevelDebugger());
auto isZebinFormat = NEO::isDeviceBinaryFormat<NEO::DeviceBinaryFormat::Zebin>(archive);
if (isSourceLevelDebuggerActive && isZebinFormat) {
auto pos = optionsString.find(NEO::CompilerOptions::allowZebin.str());
optionsString.erase(pos, pos + NEO::CompilerOptions::allowZebin.length());
optionsString += " " + NEO::CompilerOptions::disableZebin.str();
return true;
}
return false;
}
} // namespace NEO