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>
This commit is contained in:
Kacper Nowak
2022-09-27 14:19:01 +00:00
committed by Compute-Runtime-Automation
parent 4eeef388e2
commit 2285772c7e
9 changed files with 183 additions and 6 deletions

View File

@@ -286,6 +286,10 @@ ze_result_t ModuleTranslationUnit::createFromNativeBinary(const char *input, siz
}
bool rebuild = NEO::DebugManager.flags.RebuildPrecompiledKernels.get() && irBinarySize != 0;
rebuild |= NEO::isRebuiltToPatchtokensRequired(device->getNEODevice(), archive, this->options, this->isBuiltIn);
if (rebuild && irBinarySize == 0) {
return ZE_RESULT_ERROR_INVALID_NATIVE_BINARY;
}
if ((false == singleDeviceBinary.deviceBinary.empty()) && (false == rebuild)) {
this->unpackedDeviceBinary = makeCopy<char>(reinterpret_cast<const char *>(singleDeviceBinary.deviceBinary.begin()), singleDeviceBinary.deviceBinary.size());
this->unpackedDeviceBinarySize = singleDeviceBinary.deviceBinary.size();
@@ -521,6 +525,7 @@ ze_result_t ModuleImp::initialize(const ze_module_desc_t *desc, NEO::Device *neo
} else {
std::string buildFlagsInput{desc->pBuildFlags != nullptr ? desc->pBuildFlags : ""};
this->translationUnit->shouldSuppressRebuildWarning = NEO::CompilerOptions::extract(NEO::CompilerOptions::noRecompiledFromIr, buildFlagsInput);
this->translationUnit->isBuiltIn = this->type == ModuleType::Builtin ? true : false;
this->createBuildOptions(buildFlagsInput.c_str(), buildOptions, internalBuildOptions);
if (type == ModuleType::User) {

View File

@@ -77,6 +77,7 @@ struct ModuleTranslationUnit {
std::vector<char *> alignedvIsas;
NEO::specConstValuesMap specConstantsValues;
bool isBuiltIn{false};
};
struct ModuleImp : public Module {