mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-26 15:03:02 +08:00
fix: correct program header generation for shared isa allocation
- when kernels share single allocation, LOAD address in program headers should point to correct virtual address including kernel offset Related-To: NEO-7788, GSD-9836 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
43e3957e66
commit
37b7caa137
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
* Copyright (C) 2021-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -18,7 +18,7 @@ using namespace NEO::Zebin::Elf;
|
||||
|
||||
Segments::Segments() {}
|
||||
|
||||
Segments::Segments(const GraphicsAllocation *globalVarAlloc, const GraphicsAllocation *globalConstAlloc, ArrayRef<const uint8_t> &globalStrings, std::vector<KernelNameIsaPairT> &kernels) {
|
||||
Segments::Segments(const GraphicsAllocation *globalVarAlloc, const GraphicsAllocation *globalConstAlloc, ArrayRef<const uint8_t> &globalStrings, std::vector<KernelNameIsaTupleT> &kernels) {
|
||||
if (globalVarAlloc) {
|
||||
varData = {static_cast<uintptr_t>(globalVarAlloc->getGpuAddress()), globalVarAlloc->getUnderlyingBufferSize()};
|
||||
}
|
||||
@@ -28,9 +28,8 @@ Segments::Segments(const GraphicsAllocation *globalVarAlloc, const GraphicsAlloc
|
||||
if (false == globalStrings.empty()) {
|
||||
stringData = {reinterpret_cast<uintptr_t>(globalStrings.begin()), globalStrings.size()};
|
||||
}
|
||||
for (auto &[kernelName, isa] : kernels) {
|
||||
Debug::Segments::Segment kernelSegment = {static_cast<uintptr_t>(isa->getGpuAddress()), isa->getUnderlyingBufferSize()};
|
||||
nameToSegMap.insert(std::pair(kernelName, kernelSegment));
|
||||
for (auto &[kernelName, isaSegment] : kernels) {
|
||||
nameToSegMap.insert(std::pair(kernelName, isaSegment));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
* Copyright (C) 2021-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -26,7 +26,7 @@ struct Segments {
|
||||
};
|
||||
using CPUSegment = Segment;
|
||||
using GPUSegment = Segment;
|
||||
using KernelNameIsaPairT = std::pair<std::string_view, GraphicsAllocation *>;
|
||||
using KernelNameIsaTupleT = std::tuple<std::string_view, Segment>;
|
||||
using KernelNameToSegmentMap = std::unordered_map<std::string, GPUSegment>;
|
||||
|
||||
GPUSegment varData;
|
||||
@@ -34,7 +34,7 @@ struct Segments {
|
||||
CPUSegment stringData;
|
||||
KernelNameToSegmentMap nameToSegMap;
|
||||
Segments();
|
||||
Segments(const GraphicsAllocation *globalVarAlloc, const GraphicsAllocation *globalConstAlloc, ArrayRef<const uint8_t> &globalStrings, std::vector<KernelNameIsaPairT> &kernels);
|
||||
Segments(const GraphicsAllocation *globalVarAlloc, const GraphicsAllocation *globalConstAlloc, ArrayRef<const uint8_t> &globalStrings, std::vector<KernelNameIsaTupleT> &kernels);
|
||||
};
|
||||
|
||||
class DebugZebinCreator {
|
||||
|
||||
Reference in New Issue
Block a user