refactor(zebin): move files to seperate directory

* Moved zebin related files to zebin directory.
* Moved zebin related code to Zebin namespace.
* Separated zeInfo from zebin elf.
* Seperated zeInfo decoding from zebin decoder.
* Refactored populateKernelPayloadArgument function.

Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
This commit is contained in:
Krystian Chmielewski
2023-02-16 15:09:51 +00:00
committed by Compute-Runtime-Automation
parent 210b4cfeea
commit 58d3f892a9
39 changed files with 1921 additions and 1940 deletions

View File

@@ -14,11 +14,11 @@
#include "shared/source/compiler_interface/linker.h"
#include "shared/source/debugger/debugger_l0.h"
#include "shared/source/device/device.h"
#include "shared/source/device_binary_format/debug_zebin.h"
#include "shared/source/device_binary_format/device_binary_formats.h"
#include "shared/source/device_binary_format/elf/elf.h"
#include "shared/source/device_binary_format/elf/elf_encoder.h"
#include "shared/source/device_binary_format/elf/ocl_elf.h"
#include "shared/source/device_binary_format/zebin/debug_zebin.h"
#include "shared/source/execution_environment/execution_environment.h"
#include "shared/source/execution_environment/root_device_environment.h"
#include "shared/source/helpers/addressing_mode_helper.h"
@@ -481,13 +481,13 @@ ModuleImp::~ModuleImp() {
kernelImmDatas.clear();
}
NEO::Debug::Segments ModuleImp::getZebinSegments() {
NEO::Zebin::Debug::Segments ModuleImp::getZebinSegments() {
std::vector<std::pair<std::string_view, NEO::GraphicsAllocation *>> kernels;
for (const auto &kernelImmData : kernelImmDatas)
kernels.push_back({kernelImmData->getDescriptor().kernelMetadata.kernelName, kernelImmData->getIsaGraphicsAllocation()});
ArrayRef<const uint8_t> strings = {reinterpret_cast<const uint8_t *>(translationUnit->programInfo.globalStrings.initData),
translationUnit->programInfo.globalStrings.size};
return NEO::Debug::Segments(translationUnit->globalVarBuffer, translationUnit->globalConstBuffer, strings, kernels);
return NEO::Zebin::Debug::Segments(translationUnit->globalVarBuffer, translationUnit->globalConstBuffer, strings, kernels);
}
ze_result_t ModuleImp::initialize(const ze_module_desc_t *desc, NEO::Device *neoDevice) {
@@ -665,7 +665,7 @@ ze_result_t ModuleImp::initialize(const ze_module_desc_t *desc, NEO::Device *neo
void ModuleImp::createDebugZebin() {
auto refBin = ArrayRef<const uint8_t>::fromAny(translationUnit->unpackedDeviceBinary.get(), translationUnit->unpackedDeviceBinarySize);
auto segments = getZebinSegments();
auto debugZebin = NEO::Debug::createDebugZebin(refBin, segments);
auto debugZebin = NEO::Zebin::Debug::createDebugZebin(refBin, segments);
translationUnit->debugDataSize = debugZebin.size();
translationUnit->debugData.reset(new char[translationUnit->debugDataSize]);

View File

@@ -23,9 +23,9 @@
namespace NEO {
struct KernelDescriptor;
namespace Debug {
namespace Zebin::Debug {
struct Segments;
} // namespace Debug
} // namespace Zebin::Debug
} // namespace NEO
namespace L0 {
@@ -149,7 +149,7 @@ struct ModuleImp : public Module {
void copyPatchedSegments(const NEO::Linker::PatchableSegments &isaSegmentsForPatching);
void verifyDebugCapabilities();
void checkIfPrivateMemoryPerDispatchIsNeeded() override;
NEO::Debug::Segments getZebinSegments();
NEO::Zebin::Debug::Segments getZebinSegments();
void passDebugData();
void createDebugZebin();
void registerElfInDebuggerL0();