mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 05:56:36 +08:00
Refactor patching implicit args relocation
Related-To: NEO-5081 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
719aee6bcf
commit
75a5aed81d
@@ -89,13 +89,16 @@ cl_int Program::linkBinary(Device *pDevice, const void *constantsInitData, const
|
||||
}
|
||||
Linker::PatchableSegments isaSegmentsForPatching;
|
||||
std::vector<std::vector<char>> patchedIsaTempStorage;
|
||||
Linker::KernelDescriptorsT kernelDescriptors;
|
||||
if (linkerInput->getTraits().requiresPatchingOfInstructionSegments) {
|
||||
patchedIsaTempStorage.reserve(kernelInfoArray.size());
|
||||
kernelDescriptors.reserve(kernelInfoArray.size());
|
||||
for (const auto &kernelInfo : kernelInfoArray) {
|
||||
auto &kernHeapInfo = kernelInfo->heapInfo;
|
||||
const char *originalIsa = reinterpret_cast<const char *>(kernHeapInfo.pKernelHeap);
|
||||
patchedIsaTempStorage.push_back(std::vector<char>(originalIsa, originalIsa + kernHeapInfo.KernelHeapSize));
|
||||
isaSegmentsForPatching.push_back(Linker::PatchableSegment{patchedIsaTempStorage.rbegin()->data(), kernHeapInfo.KernelHeapSize});
|
||||
kernelDescriptors.push_back(&kernelInfo->kernelDescriptor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -103,7 +106,7 @@ cl_int Program::linkBinary(Device *pDevice, const void *constantsInitData, const
|
||||
bool linkSuccess = LinkingStatus::LinkedFully == linker.link(globals, constants, exportedFunctions, strings,
|
||||
globalsForPatching, constantsForPatching,
|
||||
isaSegmentsForPatching, unresolvedExternalsInfo,
|
||||
pDevice, constantsInitData, variablesInitData);
|
||||
pDevice, constantsInitData, variablesInitData, kernelDescriptors);
|
||||
setSymbols(rootDeviceIndex, linker.extractRelocatedSymbols());
|
||||
if (false == linkSuccess) {
|
||||
std::vector<std::string> kernelNames;
|
||||
@@ -126,7 +129,6 @@ cl_int Program::linkBinary(Device *pDevice, const void *constantsInitData, const
|
||||
MemoryTransferHelper::transferMemoryToAllocation(hwHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *kernelInfo->getGraphicsAllocation()),
|
||||
*pDevice, kernelInfo->getGraphicsAllocation(), 0, isaSegmentsForPatching[segmentId].hostPointer,
|
||||
static_cast<size_t>(kernHeapInfo.KernelHeapSize));
|
||||
kernelInfo->kernelDescriptor.kernelAttributes.flags.requiresImplicitArgs = linkerInput->areImplicitArgsRequired(kernelId);
|
||||
}
|
||||
}
|
||||
DBG_LOG(PrintRelocations, NEO::constructRelocationsDebugMessage(this->getSymbols(pDevice->getRootDeviceIndex())));
|
||||
|
||||
Reference in New Issue
Block a user