mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-09 22:43:00 +08:00
fix(ocl): unpack zebin binary
- unpackSingleDeviceBinary() validates target machine and extracts information from ELF sections Related-To: NEO-15574 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
a8553a55c3
commit
016582a259
@@ -3294,7 +3294,7 @@ TEST_F(ProgramBinTest, GivenSourceKernelWhenLinkingProgramThenGtpinInitInfoIsPas
|
||||
mockCompilerInterface.release();
|
||||
}
|
||||
|
||||
TEST(ProgramReplaceDeviceBinary, GivenBinaryZebinThenUseAsBothPackedAndUnpackedBinaryContainer) {
|
||||
TEST(ProgramReplaceDeviceBinary, GivenBinaryZebinThenUseAsPackedBinaryContainer) {
|
||||
ZebinTestData::ValidEmptyProgram zebin;
|
||||
std::unique_ptr<char[]> src = makeCopy(zebin.storage.data(), zebin.storage.size());
|
||||
MockContext context;
|
||||
@@ -3303,11 +3303,10 @@ TEST(ProgramReplaceDeviceBinary, GivenBinaryZebinThenUseAsBothPackedAndUnpackedB
|
||||
MockProgram program{&context, false, toClDeviceVector(*device)};
|
||||
program.replaceDeviceBinary(std::move(src), zebin.storage.size(), rootDeviceIndex);
|
||||
ASSERT_EQ(zebin.storage.size(), program.buildInfos[rootDeviceIndex].packedDeviceBinarySize);
|
||||
ASSERT_EQ(zebin.storage.size(), program.buildInfos[rootDeviceIndex].unpackedDeviceBinarySize);
|
||||
ASSERT_EQ(0u, program.buildInfos[rootDeviceIndex].unpackedDeviceBinarySize);
|
||||
ASSERT_NE(nullptr, program.buildInfos[rootDeviceIndex].packedDeviceBinary);
|
||||
ASSERT_NE(nullptr, program.buildInfos[rootDeviceIndex].unpackedDeviceBinary);
|
||||
ASSERT_EQ(nullptr, program.buildInfos[rootDeviceIndex].unpackedDeviceBinary);
|
||||
EXPECT_EQ(0, memcmp(program.buildInfos[rootDeviceIndex].packedDeviceBinary.get(), zebin.storage.data(), program.buildInfos[rootDeviceIndex].packedDeviceBinarySize));
|
||||
EXPECT_EQ(0, memcmp(program.buildInfos[rootDeviceIndex].unpackedDeviceBinary.get(), zebin.storage.data(), program.buildInfos[rootDeviceIndex].unpackedDeviceBinarySize));
|
||||
}
|
||||
|
||||
TEST(ProgramCallbackTest, whenFunctionIsNullptrThenUserDataNeedsToBeNullptr) {
|
||||
|
||||
Reference in New Issue
Block a user