Relocate debug data

Related-To: NEO-4769

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2021-02-09 14:57:16 +00:00
committed by Compute-Runtime-Automation
parent a0d3e8b352
commit 6dd0f0c728
17 changed files with 579 additions and 51 deletions

View File

@@ -353,14 +353,6 @@ bool ModuleImp::initialize(const ze_module_desc_t *desc, NEO::Device *neoDevice)
verifyDebugCapabilities();
this->updateBuildLog(neoDevice);
if (debugEnabled && device->getSourceLevelDebugger()) {
for (auto kernelInfo : this->translationUnit->programInfo.kernelInfos) {
device->getSourceLevelDebugger()->notifyKernelDebugData(kernelInfo->kernelDescriptor.external.debugData.get(),
kernelInfo->kernelDescriptor.kernelMetadata.kernelName,
kernelInfo->heapInfo.pKernelHeap,
kernelInfo->heapInfo.KernelHeapSize);
}
}
if (false == success) {
return false;
@@ -376,6 +368,28 @@ bool ModuleImp::initialize(const ze_module_desc_t *desc, NEO::Device *neoDevice)
}
this->maxGroupSize = static_cast<uint32_t>(this->translationUnit->device->getNEODevice()->getDeviceInfo().maxWorkGroupSize);
if (debugEnabled) {
if (device->getSourceLevelDebugger()) {
for (auto kernelInfo : this->translationUnit->programInfo.kernelInfos) {
NEO::DebugData *notifyDebugData = kernelInfo->kernelDescriptor.external.debugData.get();
NEO::DebugData relocatedDebugData;
if (kernelInfo->kernelDescriptor.external.relocatedDebugData.get()) {
relocatedDebugData.genIsa = kernelInfo->kernelDescriptor.external.debugData->genIsa;
relocatedDebugData.genIsaSize = kernelInfo->kernelDescriptor.external.debugData->genIsaSize;
relocatedDebugData.vIsa = reinterpret_cast<char *>(kernelInfo->kernelDescriptor.external.relocatedDebugData.get());
relocatedDebugData.vIsaSize = kernelInfo->kernelDescriptor.external.debugData->vIsaSize;
notifyDebugData = &relocatedDebugData;
}
device->getSourceLevelDebugger()->notifyKernelDebugData(notifyDebugData,
kernelInfo->kernelDescriptor.kernelMetadata.kernelName,
kernelInfo->heapInfo.pKernelHeap,
kernelInfo->heapInfo.KernelHeapSize);
}
}
}
return this->linkBinary();
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2020 Intel Corporation
* Copyright (C) 2019-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -120,6 +120,7 @@ struct ModuleImp : public Module {
protected:
void copyPatchedSegments(const NEO::Linker::PatchableSegments &isaSegmentsForPatching);
void verifyDebugCapabilities();
Device *device = nullptr;
PRODUCT_FAMILY productFamily{};
std::unique_ptr<ModuleTranslationUnit> translationUnit;