mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
L0 Support for Dynamic Module Linking for undefined symbols
- Support for L0 apps to handle undefined symbols reported by IGC - Removed duplication of symbol in exported symbol list and relocation for properly resolving the symbol during dynamic link - Add export module's exported function surface state to the import module's residency container during dynamic linkage to allow import kernels to execute exported functions. Signed-off-by: Spruit, Neil R <neil.r.spruit@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
2125718091
commit
e602f4829d
@@ -75,6 +75,15 @@ bool LinkerInput::decodeExportedFunctionsSymbolTable(const void *data, uint32_t
|
||||
DEBUG_BREAK_IF(true);
|
||||
this->valid = false;
|
||||
return false;
|
||||
case vISA::S_UNDEF:
|
||||
if (this->undefinedSymbolsAllowed) {
|
||||
symbols.erase(symbolEntryIt->s_name);
|
||||
break;
|
||||
} else {
|
||||
DEBUG_BREAK_IF(true);
|
||||
this->valid = false;
|
||||
return false;
|
||||
}
|
||||
case vISA::S_GLOBAL_VAR:
|
||||
symbolInfo.segment = SegmentType::GlobalVariables;
|
||||
traits.exportsGlobalVariables = true;
|
||||
|
||||
@@ -135,6 +135,8 @@ struct LinkerInput {
|
||||
return valid;
|
||||
}
|
||||
|
||||
bool undefinedSymbolsAllowed = false;
|
||||
|
||||
protected:
|
||||
Traits traits;
|
||||
SymbolMap symbols;
|
||||
|
||||
@@ -42,6 +42,7 @@ struct ProgramInfo {
|
||||
std::vector<KernelInfo *> kernelInfos;
|
||||
Elf::Elf<Elf::EI_CLASS_64> decodedElf;
|
||||
uint32_t grfSize = 32U;
|
||||
bool levelZeroDynamicLinkProgram = false;
|
||||
};
|
||||
|
||||
size_t getMaxInlineSlmNeeded(const ProgramInfo &programInfo);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020 Intel Corporation
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -34,6 +34,7 @@ void populateSingleKernelInfo(ProgramInfo &dst, const PatchTokenBinary::ProgramF
|
||||
|
||||
if (decodedKernel.tokens.programSymbolTable) {
|
||||
dst.prepareLinkerInputStorage();
|
||||
dst.linkerInput->undefinedSymbolsAllowed = dst.levelZeroDynamicLinkProgram;
|
||||
dst.linkerInput->decodeExportedFunctionsSymbolTable(decodedKernel.tokens.programSymbolTable + 1, decodedKernel.tokens.programSymbolTable->NumEntries, kernelNum);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user