feat(zebin): Add support for ELF section type SHT_NOBITS

This commit adds support for parsing SHT_NOBITS zebin's ELF sections
(containing global/constant zero-initialized data).

Related-To: NEO-7196
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
This commit is contained in:
Kacper Nowak
2023-01-24 13:16:02 +00:00
committed by Compute-Runtime-Automation
parent 31154dc20b
commit fa03aa9a40
18 changed files with 421 additions and 85 deletions

View File

@@ -1016,6 +1016,22 @@ TEST(MemoryManagerTest, givenDebugContextSaveAreaTypeWhenGetAllocationDataIsCall
EXPECT_TRUE(allocData.flags.zeroMemory);
}
TEST(MemoryManagerTest, givenAllocationTypeConstantOrGlobalSurfaceWhenGetAllocationDataIsCalledThenZeroMemoryFlagIsSet) {
MockMemoryManager mockMemoryManager;
AllocationProperties propertiesGlobal{mockRootDeviceIndex, 1, AllocationType::GLOBAL_SURFACE, mockDeviceBitfield};
AllocationProperties propertiesConstant{mockRootDeviceIndex, 1, AllocationType::CONSTANT_SURFACE, mockDeviceBitfield};
{
AllocationData allocData;
mockMemoryManager.getAllocationData(allocData, propertiesGlobal, nullptr, mockMemoryManager.createStorageInfoFromProperties(propertiesGlobal));
EXPECT_TRUE(allocData.flags.zeroMemory);
}
{
AllocationData allocData;
mockMemoryManager.getAllocationData(allocData, propertiesConstant, nullptr, mockMemoryManager.createStorageInfoFromProperties(propertiesConstant));
EXPECT_TRUE(allocData.flags.zeroMemory);
}
}
TEST(MemoryManagerTest, givenPropertiesWithOsContextWhenGetAllocationDataIsCalledThenOsContextIsSet) {
AllocationData allocData;
MockMemoryManager mockMemoryManager;