Allow for zebin rebuild when IR is present

This commits adds rebuilding zebin binary.
If zebin is built for different device and has SPIRV, then new ze binary
will be built using SPIRV.

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
This commit is contained in:
Krystian Chmielewski
2022-04-07 12:29:43 +00:00
committed by Compute-Runtime-Automation
parent e9ebd10ab8
commit 01a719cf33
8 changed files with 55 additions and 19 deletions

View File

@@ -64,10 +64,12 @@ cl_int Program::build(
deviceBuildInfos[device].buildStatus = CL_BUILD_IN_PROGRESS;
}
if (nullptr != buildOptions) {
options = buildOptions;
} else if (this->createdFrom != CreatedFrom::BINARY) {
options = "";
if (false == requiresRebuild) {
if (nullptr != buildOptions) {
options = buildOptions;
} else if (this->createdFrom != CreatedFrom::BINARY) {
options = "";
}
}
const bool shouldSuppressRebuildWarning{CompilerOptions::extract(CompilerOptions::noRecompiledFromIr, options)};
@@ -130,7 +132,7 @@ cl_int Program::build(
NEO::TranslationOutput compilerOuput = {};
for (const auto &clDevice : deviceVector) {
if (shouldWarnAboutRebuild && !shouldSuppressRebuildWarning) {
if (requiresRebuild && !shouldSuppressRebuildWarning) {
this->updateBuildLog(clDevice->getRootDeviceIndex(), CompilerWarnings::recompiledFromIr.data(), CompilerWarnings::recompiledFromIr.length());
}
auto compilerErr = pCompilerInterface->build(clDevice->getDevice(), inputArgs, compilerOuput);