Cleanup hw_parse.h

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2021-10-13 08:58:23 +00:00
committed by Compute-Runtime-Automation
parent c595cccf5d
commit 52c75e92da
30 changed files with 125 additions and 107 deletions

View File

@@ -193,7 +193,7 @@ void HardwareParse::findHardwareCommands<GenGfxFamily>(IndirectHeap *dsh) {
}
template <>
const void *HardwareParse::getStatelessArgumentPointer<GenGfxFamily>(const Kernel &kernel, uint32_t indexArg, IndirectHeap &ioh, uint32_t rootDeviceIndex) {
const void *HardwareParse::getStatelessArgumentPointer<GenGfxFamily>(const KernelInfo &kernelInfo, uint32_t indexArg, IndirectHeap &ioh, uint32_t rootDeviceIndex) {
typedef typename GenGfxFamily::COMPUTE_WALKER COMPUTE_WALKER;
typedef typename GenGfxFamily::STATE_BASE_ADDRESS STATE_BASE_ADDRESS;
@@ -204,10 +204,9 @@ const void *HardwareParse::getStatelessArgumentPointer<GenGfxFamily>(const Kerne
auto cmdSBA = (STATE_BASE_ADDRESS *)cmdStateBaseAddress;
EXPECT_NE(nullptr, cmdSBA);
auto argOffset = std::numeric_limits<uint32_t>::max();
auto &kernelInfo = kernel.getKernelInfo();
// Determine where the argument is
const auto &arg = kernel.getKernelInfo().getArgDescriptorAt(indexArg);
const auto &arg = kernelInfo.getArgDescriptorAt(indexArg);
if (arg.is<ArgDescriptor::ArgTPointer>() && isValidOffset(arg.as<ArgDescPointer>().stateless)) {
argOffset = arg.as<ArgDescPointer>().stateless;
} else {

View File

@@ -14,9 +14,6 @@
#include "shared/test/common/cmd_parse/gen_cmd_parse.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "opencl/source/command_queue/command_queue.h"
#include "opencl/source/kernel/kernel.h"
#include "gtest/gtest.h"
namespace NEO {
@@ -72,14 +69,12 @@ struct HardwareParse {
}
template <typename FamilyType>
void parseCommands(NEO::CommandQueue &commandQueue) {
auto &commandStreamReceiver = commandQueue.getGpgpuCommandStreamReceiver();
void parseCommands(NEO::CommandStreamReceiver &commandStreamReceiver, NEO::LinearStream &commandStream) {
auto &commandStreamCSR = commandStreamReceiver.getCS();
parseCommands<FamilyType>(commandStreamCSR, startCSRCS);
startCSRCS = commandStreamCSR.getUsed();
auto &commandStream = commandQueue.getCS(1024);
if (previousCS != &commandStream) {
startCS = 0;
}
@@ -132,7 +127,7 @@ struct HardwareParse {
}
template <typename FamilyType>
const void *getStatelessArgumentPointer(const Kernel &kernel, uint32_t indexArg, IndirectHeap &ioh, uint32_t rootDeviceIndex);
const void *getStatelessArgumentPointer(const KernelInfo &kernelInfo, uint32_t indexArg, IndirectHeap &ioh, uint32_t rootDeviceIndex);
template <typename CmdType>
CmdType *getCommand(GenCmdList::iterator itorStart, GenCmdList::iterator itorEnd) {

View File

@@ -5,6 +5,7 @@
*
*/
#include "shared/source/program/kernel_info.h"
#include "shared/test/common/cmd_parse/hw_parse.h"
namespace NEO {
@@ -94,7 +95,7 @@ void HardwareParse::findHardwareCommands() {
}
template <typename FamilyType>
const void *HardwareParse::getStatelessArgumentPointer(const Kernel &kernel, uint32_t indexArg, IndirectHeap &ioh, uint32_t rootDeviceIndex) {
const void *HardwareParse::getStatelessArgumentPointer(const KernelInfo &kernelInfo, uint32_t indexArg, IndirectHeap &ioh, uint32_t rootDeviceIndex) {
typedef typename FamilyType::GPGPU_WALKER GPGPU_WALKER;
typedef typename FamilyType::STATE_BASE_ADDRESS STATE_BASE_ADDRESS;
@@ -115,7 +116,7 @@ const void *HardwareParse::getStatelessArgumentPointer(const Kernel &kernel, uin
offsetCrossThreadData);
// Determine where the argument is
const auto &arg = kernel.getKernelInfo().getArgDescriptorAt(indexArg);
const auto &arg = kernelInfo.getArgDescriptorAt(indexArg);
if (arg.is<ArgDescriptor::ArgTPointer>() && isValidOffset(arg.as<ArgDescPointer>().stateless)) {
return ptrOffset(pCrossThreadData, arg.as<ArgDescPointer>().stateless);
}

View File

@@ -85,5 +85,5 @@ template struct CmdParse<GenGfxFamily>;
namespace NEO {
template void HardwareParse::findHardwareCommands<ICLFamily>();
template void HardwareParse::findHardwareCommands<ICLFamily>(IndirectHeap *);
template const void *HardwareParse::getStatelessArgumentPointer<ICLFamily>(const Kernel &kernel, uint32_t indexArg, IndirectHeap &ioh, uint32_t rootDeviceIndex);
template const void *HardwareParse::getStatelessArgumentPointer<ICLFamily>(const KernelInfo &kernelInfo, uint32_t indexArg, IndirectHeap &ioh, uint32_t rootDeviceIndex);
} // namespace NEO

View File

@@ -128,5 +128,5 @@ template struct CmdParse<GenGfxFamily>;
namespace NEO {
template void HardwareParse::findHardwareCommands<TGLLPFamily>();
template void HardwareParse::findHardwareCommands<TGLLPFamily>(IndirectHeap *);
template const void *HardwareParse::getStatelessArgumentPointer<TGLLPFamily>(const Kernel &kernel, uint32_t indexArg, IndirectHeap &ioh, uint32_t rootDeviceIndex);
template const void *HardwareParse::getStatelessArgumentPointer<TGLLPFamily>(const KernelInfo &kernelInfo, uint32_t indexArg, IndirectHeap &ioh, uint32_t rootDeviceIndex);
} // namespace NEO

View File

@@ -67,5 +67,5 @@ template struct CmdParse<GenGfxFamily>;
namespace NEO {
template void HardwareParse::findHardwareCommands<BDWFamily>();
template void HardwareParse::findHardwareCommands<BDWFamily>(IndirectHeap *);
template const void *HardwareParse::getStatelessArgumentPointer<BDWFamily>(const Kernel &kernel, uint32_t indexArg, IndirectHeap &ioh, uint32_t rootDeviceIndex);
template const void *HardwareParse::getStatelessArgumentPointer<BDWFamily>(const KernelInfo &kernelInfo, uint32_t indexArg, IndirectHeap &ioh, uint32_t rootDeviceIndex);
} // namespace NEO

View File

@@ -85,5 +85,5 @@ template struct CmdParse<GenGfxFamily>;
namespace NEO {
template void HardwareParse::findHardwareCommands<SKLFamily>();
template void HardwareParse::findHardwareCommands<SKLFamily>(IndirectHeap *);
template const void *HardwareParse::getStatelessArgumentPointer<SKLFamily>(const Kernel &kernel, uint32_t indexArg, IndirectHeap &ioh, uint32_t rootDeviceIndex);
template const void *HardwareParse::getStatelessArgumentPointer<SKLFamily>(const KernelInfo &kernelInfo, uint32_t indexArg, IndirectHeap &ioh, uint32_t rootDeviceIndex);
} // namespace NEO