Refactor Ults finding hardware commands

- use CPU address for found dynamicStateHeap address in
StateBaseAddress command

Change-Id: I2d857c5a069f5a8f46169d2047cdb27efd3502b8
This commit is contained in:
Hoppe, Mateusz
2019-02-01 13:13:12 +01:00
committed by sys_ocldev
parent eaa241fd6a
commit 509ed273c4
10 changed files with 24 additions and 15 deletions

View File

@ -64,6 +64,9 @@ struct HardwareParse {
template <typename FamilyType>
void findHardwareCommands();
template <typename FamilyType>
void findHardwareCommands(IndirectHeap *dsh);
template <typename FamilyType>
void parseCommands(OCLRT::LinearStream &commandStream, size_t startOffset = 0) {
ASSERT_LE(startOffset, commandStream.getUsed());
@ -91,7 +94,7 @@ struct HardwareParse {
previousCS = &commandStream;
sizeUsed = commandStream.getUsed();
findHardwareCommands<FamilyType>();
findHardwareCommands<FamilyType>(&commandStreamReceiver.getIndirectHeap(IndirectHeap::DYNAMIC_STATE, 0));
}
template <typename FamilyType>

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2018 Intel Corporation
* Copyright (C) 2018-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -10,7 +10,7 @@
namespace OCLRT {
template <typename FamilyType>
void HardwareParse::findHardwareCommands() {
void HardwareParse::findHardwareCommands(IndirectHeap *dsh) {
typedef typename FamilyType::GPGPU_WALKER GPGPU_WALKER;
typedef typename FamilyType::PIPELINE_SELECT PIPELINE_SELECT;
typedef typename FamilyType::STATE_BASE_ADDRESS STATE_BASE_ADDRESS;
@ -62,6 +62,9 @@ void HardwareParse::findHardwareCommands() {
// Extract the dynamicStateHeap
dynamicStateHeap = cmdSBA->getDynamicStateBaseAddress();
if (dsh && (dsh->getHeapGpuBase() == dynamicStateHeap)) {
dynamicStateHeap = reinterpret_cast<uint64_t>(dsh->getCpuBase());
}
ASSERT_NE(0u, dynamicStateHeap);
}
@ -76,6 +79,11 @@ void HardwareParse::findHardwareCommands() {
}
}
template <typename FamilyType>
void HardwareParse::findHardwareCommands() {
findHardwareCommands<FamilyType>(nullptr);
}
template <typename FamilyType>
const void *HardwareParse::getStatelessArgumentPointer(const Kernel &kernel, uint32_t indexArg, IndirectHeap &ioh) {
typedef typename FamilyType::GPGPU_WALKER GPGPU_WALKER;