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).
- Correction: in CTNI path, do not add related symbol if surface has not
been allocated.

Related-To: NEO-7196
Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
This commit is contained in:
Kacper Nowak
2023-02-08 17:05:30 +00:00
committed by Compute-Runtime-Automation
parent c0664896ad
commit 7790e208fd
20 changed files with 451 additions and 86 deletions

View File

@@ -382,12 +382,16 @@ ze_result_t ModuleTranslationUnit::processUnpackedBinary() {
}
auto svmAllocsManager = device->getDriverHandle()->getSvmAllocsManager();
if (programInfo.globalConstants.size != 0) {
this->globalConstBuffer = NEO::allocateGlobalsSurface(svmAllocsManager, *device->getNEODevice(), programInfo.globalConstants.size, true, programInfo.linkerInput.get(), programInfo.globalConstants.initData);
auto globalConstDataSize = programInfo.globalConstants.size + programInfo.globalConstants.zeroInitSize;
if (globalConstDataSize != 0) {
this->globalConstBuffer = NEO::allocateGlobalsSurface(svmAllocsManager, *device->getNEODevice(), globalConstDataSize,
programInfo.globalConstants.zeroInitSize, true, programInfo.linkerInput.get(), programInfo.globalConstants.initData);
}
if (programInfo.globalVariables.size != 0) {
this->globalVarBuffer = NEO::allocateGlobalsSurface(svmAllocsManager, *device->getNEODevice(), programInfo.globalVariables.size, false, programInfo.linkerInput.get(), programInfo.globalVariables.initData);
auto globalVariablesDataSize = programInfo.globalVariables.size + programInfo.globalVariables.zeroInitSize;
if (globalVariablesDataSize != 0) {
this->globalVarBuffer = NEO::allocateGlobalsSurface(svmAllocsManager, *device->getNEODevice(), globalVariablesDataSize,
programInfo.globalVariables.zeroInitSize, false, programInfo.linkerInput.get(), programInfo.globalVariables.initData);
}
for (auto &kernelInfo : this->programInfo.kernelInfos) {