mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Revert "Allow for zebin rebuild when IR is present"
This reverts commit 2ae3f3e521
.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
fe9fe80fc6
commit
64d3f95410
@ -64,12 +64,10 @@ cl_int Program::build(
|
||||
deviceBuildInfos[device].buildStatus = CL_BUILD_IN_PROGRESS;
|
||||
}
|
||||
|
||||
if (this->createdFrom != CreatedFrom::BINARY) {
|
||||
if (nullptr != buildOptions) {
|
||||
options = buildOptions;
|
||||
} else {
|
||||
options = "";
|
||||
}
|
||||
if (nullptr != buildOptions) {
|
||||
options = buildOptions;
|
||||
} else if (this->createdFrom != CreatedFrom::BINARY) {
|
||||
options = "";
|
||||
}
|
||||
|
||||
const bool shouldSuppressRebuildWarning{CompilerOptions::extract(CompilerOptions::noRecompiledFromIr, options)};
|
||||
|
@ -5,7 +5,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/compiler_interface/compiler_options/compiler_options.h"
|
||||
#include "shared/source/compiler_interface/intermediate_representations.h"
|
||||
#include "shared/source/device_binary_format/device_binary_formats.h"
|
||||
#include "shared/source/device_binary_format/elf/elf_decoder.h"
|
||||
@ -47,13 +46,6 @@ SingleDeviceBinary unpackSingleDeviceBinary<NEO::DeviceBinaryFormat::Zebin>(cons
|
||||
break;
|
||||
}
|
||||
|
||||
ArrayRef<const uint8_t> intermediateRepresentation;
|
||||
for (auto &elfSH : elf.sectionHeaders) {
|
||||
if (elfSH.header->type == Elf::SHT_ZEBIN_SPIRV) {
|
||||
intermediateRepresentation = elfSH.data;
|
||||
}
|
||||
}
|
||||
|
||||
bool validForTarget = true;
|
||||
if (elf.elfFileHeader->machine == Elf::ELF_MACHINE::EM_INTELGT) {
|
||||
validForTarget &= validateTargetDevice(elf, requestedTargetDevice);
|
||||
@ -66,22 +58,16 @@ SingleDeviceBinary unpackSingleDeviceBinary<NEO::DeviceBinaryFormat::Zebin>(cons
|
||||
validForTarget &= (8U == requestedTargetDevice.maxPointerSizeInBytes);
|
||||
}
|
||||
|
||||
if (false == validForTarget) {
|
||||
outErrReason = "Unhandled target device";
|
||||
return {};
|
||||
}
|
||||
|
||||
SingleDeviceBinary ret;
|
||||
ret.deviceBinary = archive;
|
||||
ret.format = NEO::DeviceBinaryFormat::Zebin;
|
||||
ret.targetDevice = requestedTargetDevice;
|
||||
|
||||
if (false == validForTarget) {
|
||||
if (false == intermediateRepresentation.empty()) {
|
||||
ret.intermediateRepresentation = intermediateRepresentation;
|
||||
ret.buildOptions = NEO::CompilerOptions::allowZebin;
|
||||
ret.deviceBinary = {};
|
||||
} else {
|
||||
outErrReason = "Unhandled target device";
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -358,26 +358,3 @@ TEST(UnpackSingleDeviceBinaryZebin, WhenMachineIsIntelGTAndIntelGTNoteSectionIsV
|
||||
EXPECT_TRUE(unpackWarnings.empty());
|
||||
EXPECT_TRUE(unpackErrors.empty());
|
||||
}
|
||||
|
||||
TEST(UnpackSingleDeviceBinaryZebin, WhenZebinIsNotValidForTargetAndHasSPIRVThenSetIRAndBuildOptions) {
|
||||
ZebinTestData::ValidEmptyProgram zebin;
|
||||
const uint8_t spirvData[30] = {0xd};
|
||||
zebin.appendSection(NEO::Elf::SHT_ZEBIN_SPIRV, NEO::Elf::SectionsNamesZebin::spv, spirvData);
|
||||
|
||||
zebin.elfHeader->type = NEO::Elf::ET_ZEBIN_EXE;
|
||||
zebin.elfHeader->machine = IGFX_UNKNOWN;
|
||||
|
||||
NEO::TargetDevice targetDevice;
|
||||
targetDevice.productFamily = IGFX_SKYLAKE;
|
||||
targetDevice.maxPointerSizeInBytes = 8;
|
||||
|
||||
std::string unpackErrors;
|
||||
std::string unpackWarnings;
|
||||
auto unpackResult = NEO::unpackSingleDeviceBinary<NEO::DeviceBinaryFormat::Zebin>(zebin.storage, "", targetDevice, unpackErrors, unpackWarnings);
|
||||
EXPECT_EQ(NEO::DeviceBinaryFormat::Zebin, unpackResult.format);
|
||||
EXPECT_TRUE(unpackResult.deviceBinary.empty());
|
||||
|
||||
EXPECT_FALSE(unpackResult.intermediateRepresentation.empty());
|
||||
EXPECT_EQ(0, memcmp(spirvData, unpackResult.intermediateRepresentation.begin(), sizeof(spirvData)));
|
||||
EXPECT_STREQ(NEO::CompilerOptions::allowZebin.begin(), unpackResult.buildOptions.begin());
|
||||
}
|
||||
|
Reference in New Issue
Block a user