mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
Move cmd parse files to shared directory
Related-To: NEO-4519 Change-Id: Id055631d68f1d73ae39c4976843080b8f8e05f1c Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
70a28f4bd9
commit
0791b25214
20
shared/test/unit_test/cmd_parse/CMakeLists.txt
Normal file
20
shared/test/unit_test/cmd_parse/CMakeLists.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
#
|
||||
# Copyright (C) 2020 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
set(NEO_SHARED_TESTS_CMD_PARSE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmd_parse_base.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmd_parse_base_mi_arb.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmd_parse_compute_mode.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmd_parse_gpgpu_walker.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmd_parse_mi_arb.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmd_parse_sip.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gen_cmd_parse.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_parse.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_parse.inl
|
||||
)
|
||||
|
||||
set_property(GLOBAL PROPERTY NEO_SHARED_TESTS_CMD_PARSE ${NEO_SHARED_TESTS_CMD_PARSE})
|
||||
352
shared/test/unit_test/cmd_parse/cmd_parse_base.inl
Normal file
352
shared/test/unit_test/cmd_parse/cmd_parse_base.inl
Normal file
@@ -0,0 +1,352 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/unit_test/cmd_parse/gen_cmd_parse.h"
|
||||
|
||||
// clang-format off
|
||||
using namespace NEO;
|
||||
using MI_ARB_CHECK = GenStruct::MI_ARB_CHECK;
|
||||
using MI_ATOMIC = GenStruct::MI_ATOMIC;
|
||||
using MI_BATCH_BUFFER_END = GenStruct::MI_BATCH_BUFFER_END;
|
||||
using MI_BATCH_BUFFER_START = GenStruct::MI_BATCH_BUFFER_START;
|
||||
using MI_LOAD_REGISTER_IMM = GenStruct::MI_LOAD_REGISTER_IMM;
|
||||
using MI_LOAD_REGISTER_MEM = GenStruct::MI_LOAD_REGISTER_MEM;
|
||||
using MI_STORE_REGISTER_MEM = GenStruct::MI_STORE_REGISTER_MEM;
|
||||
using MI_NOOP = GenStruct::MI_NOOP;
|
||||
using PIPE_CONTROL = GenStruct::PIPE_CONTROL;
|
||||
using PIPELINE_SELECT = GenStruct::PIPELINE_SELECT;
|
||||
using STATE_BASE_ADDRESS = GenStruct::STATE_BASE_ADDRESS;
|
||||
using MI_REPORT_PERF_COUNT = GenStruct::MI_REPORT_PERF_COUNT;
|
||||
using MI_MATH = GenStruct::MI_MATH;
|
||||
using MI_LOAD_REGISTER_REG = GenStruct::MI_LOAD_REGISTER_REG;
|
||||
using MI_SEMAPHORE_WAIT = GenStruct::MI_SEMAPHORE_WAIT;
|
||||
using MI_STORE_DATA_IMM = GenStruct::MI_STORE_DATA_IMM;
|
||||
using MI_FLUSH_DW = GenStruct::MI_FLUSH_DW;
|
||||
using XY_COPY_BLT = GenGfxFamily::XY_COPY_BLT;
|
||||
// clang-format on
|
||||
|
||||
template <>
|
||||
STATE_BASE_ADDRESS *genCmdCast<STATE_BASE_ADDRESS *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<STATE_BASE_ADDRESS *>(buffer);
|
||||
|
||||
return STATE_BASE_ADDRESS::COMMAND_TYPE_GFXPIPE == pCmd->TheStructure.Common.CommandType &&
|
||||
STATE_BASE_ADDRESS::COMMAND_SUBTYPE_GFXPIPE_COMMON == pCmd->TheStructure.Common.CommandSubtype &&
|
||||
STATE_BASE_ADDRESS::_3D_COMMAND_OPCODE_GFXPIPE_NONPIPELINED == pCmd->TheStructure.Common._3DCommandOpcode &&
|
||||
STATE_BASE_ADDRESS::_3D_COMMAND_SUB_OPCODE_STATE_BASE_ADDRESS == pCmd->TheStructure.Common._3DCommandSubOpcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
PIPE_CONTROL *genCmdCast<PIPE_CONTROL *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<PIPE_CONTROL *>(buffer);
|
||||
|
||||
return PIPE_CONTROL::COMMAND_TYPE_GFXPIPE == pCmd->TheStructure.Common.CommandType &&
|
||||
PIPE_CONTROL::COMMAND_SUBTYPE_GFXPIPE_3D == pCmd->TheStructure.Common.CommandSubtype &&
|
||||
PIPE_CONTROL::_3D_COMMAND_OPCODE_PIPE_CONTROL == pCmd->TheStructure.Common._3DCommandOpcode &&
|
||||
PIPE_CONTROL::_3D_COMMAND_SUB_OPCODE_PIPE_CONTROL == pCmd->TheStructure.Common._3DCommandSubOpcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
PIPELINE_SELECT *genCmdCast<PIPELINE_SELECT *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<PIPELINE_SELECT *>(buffer);
|
||||
|
||||
return PIPELINE_SELECT::COMMAND_TYPE_GFXPIPE == pCmd->TheStructure.Common.CommandType &&
|
||||
PIPELINE_SELECT::COMMAND_SUBTYPE_GFXPIPE_SINGLE_DW == pCmd->TheStructure.Common.CommandSubtype &&
|
||||
PIPELINE_SELECT::_3D_COMMAND_OPCODE_GFXPIPE_NONPIPELINED == pCmd->TheStructure.Common._3DCommandOpcode &&
|
||||
PIPELINE_SELECT::_3D_COMMAND_SUB_OPCODE_PIPELINE_SELECT == pCmd->TheStructure.Common._3DCommandSubOpcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
MI_LOAD_REGISTER_IMM *genCmdCast<MI_LOAD_REGISTER_IMM *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<MI_LOAD_REGISTER_IMM *>(buffer);
|
||||
|
||||
return MI_LOAD_REGISTER_IMM::COMMAND_TYPE_MI_COMMAND == pCmd->TheStructure.Common.CommandType &&
|
||||
MI_LOAD_REGISTER_IMM::MI_COMMAND_OPCODE_MI_LOAD_REGISTER_IMM == pCmd->TheStructure.Common.MiCommandOpcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
MI_NOOP *genCmdCast<MI_NOOP *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<MI_NOOP *>(buffer);
|
||||
|
||||
return MI_NOOP::COMMAND_TYPE_MI_COMMAND == pCmd->TheStructure.Common.CommandType &&
|
||||
MI_NOOP::MI_COMMAND_OPCODE_MI_NOOP == pCmd->TheStructure.Common.MiCommandOpcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
MI_ATOMIC *genCmdCast<MI_ATOMIC *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<MI_ATOMIC *>(buffer);
|
||||
|
||||
return MI_ATOMIC::COMMAND_TYPE_MI_COMMAND == pCmd->TheStructure.Common.CommandType &&
|
||||
MI_ATOMIC::MI_COMMAND_OPCODE_MI_ATOMIC == pCmd->TheStructure.Common.MiCommandOpcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
MI_BATCH_BUFFER_END *genCmdCast<MI_BATCH_BUFFER_END *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<MI_BATCH_BUFFER_END *>(buffer);
|
||||
|
||||
return MI_BATCH_BUFFER_END::COMMAND_TYPE_MI_COMMAND == pCmd->TheStructure.Common.CommandType &&
|
||||
MI_BATCH_BUFFER_END::MI_COMMAND_OPCODE_MI_BATCH_BUFFER_END == pCmd->TheStructure.Common.MiCommandOpcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
MI_BATCH_BUFFER_START *genCmdCast<MI_BATCH_BUFFER_START *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<MI_BATCH_BUFFER_START *>(buffer);
|
||||
|
||||
return MI_BATCH_BUFFER_START::COMMAND_TYPE_MI_COMMAND == pCmd->TheStructure.Common.CommandType &&
|
||||
MI_BATCH_BUFFER_START::MI_COMMAND_OPCODE_MI_BATCH_BUFFER_START == pCmd->TheStructure.Common.MiCommandOpcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
MI_LOAD_REGISTER_MEM *genCmdCast<MI_LOAD_REGISTER_MEM *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<MI_LOAD_REGISTER_MEM *>(buffer);
|
||||
|
||||
return MI_LOAD_REGISTER_MEM::COMMAND_TYPE_MI_COMMAND == pCmd->TheStructure.Common.CommandType &&
|
||||
MI_LOAD_REGISTER_MEM::MI_COMMAND_OPCODE_MI_LOAD_REGISTER_MEM == pCmd->TheStructure.Common.MiCommandOpcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
MI_STORE_REGISTER_MEM *genCmdCast<MI_STORE_REGISTER_MEM *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<MI_STORE_REGISTER_MEM *>(buffer);
|
||||
|
||||
return MI_STORE_REGISTER_MEM::COMMAND_TYPE_MI_COMMAND == pCmd->TheStructure.Common.CommandType &&
|
||||
MI_STORE_REGISTER_MEM::MI_COMMAND_OPCODE_MI_STORE_REGISTER_MEM == pCmd->TheStructure.Common.MiCommandOpcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
MI_REPORT_PERF_COUNT *genCmdCast<MI_REPORT_PERF_COUNT *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<MI_REPORT_PERF_COUNT *>(buffer);
|
||||
|
||||
return MI_REPORT_PERF_COUNT::COMMAND_TYPE_MI_COMMAND == pCmd->TheStructure.Common.CommandType &&
|
||||
MI_REPORT_PERF_COUNT::MI_COMMAND_OPCODE_MI_REPORT_PERF_COUNT == pCmd->TheStructure.Common.MiCommandOpcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
MI_MATH *genCmdCast<MI_MATH *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<MI_MATH *>(buffer);
|
||||
|
||||
return MI_MATH::COMMAND_TYPE_MI_COMMAND == pCmd->DW0.BitField.InstructionType &&
|
||||
MI_MATH::MI_COMMAND_OPCODE_MI_MATH == pCmd->DW0.BitField.InstructionOpcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
MI_LOAD_REGISTER_REG *genCmdCast<MI_LOAD_REGISTER_REG *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<MI_LOAD_REGISTER_REG *>(buffer);
|
||||
|
||||
return MI_LOAD_REGISTER_REG::COMMAND_TYPE_MI_COMMAND == pCmd->TheStructure.Common.CommandType &&
|
||||
MI_LOAD_REGISTER_REG::MI_COMMAND_OPCODE_MI_LOAD_REGISTER_REG == pCmd->TheStructure.Common.MiCommandOpcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
MI_SEMAPHORE_WAIT *genCmdCast<MI_SEMAPHORE_WAIT *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<MI_SEMAPHORE_WAIT *>(buffer);
|
||||
|
||||
return MI_SEMAPHORE_WAIT::COMMAND_TYPE_MI_COMMAND == pCmd->TheStructure.Common.CommandType &&
|
||||
MI_SEMAPHORE_WAIT::MI_COMMAND_OPCODE_MI_SEMAPHORE_WAIT == pCmd->TheStructure.Common.MiCommandOpcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
MI_STORE_DATA_IMM *genCmdCast<MI_STORE_DATA_IMM *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<MI_STORE_DATA_IMM *>(buffer);
|
||||
|
||||
return MI_STORE_DATA_IMM::COMMAND_TYPE_MI_COMMAND == pCmd->TheStructure.Common.CommandType &&
|
||||
MI_STORE_DATA_IMM::MI_COMMAND_OPCODE_MI_STORE_DATA_IMM == pCmd->TheStructure.Common.MiCommandOpcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
MI_FLUSH_DW *genCmdCast<MI_FLUSH_DW *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<MI_FLUSH_DW *>(buffer);
|
||||
|
||||
return MI_FLUSH_DW::COMMAND_TYPE_MI_COMMAND == pCmd->TheStructure.Common.CommandType &&
|
||||
MI_FLUSH_DW::MI_COMMAND_OPCODE_MI_FLUSH_DW == pCmd->TheStructure.Common.MiCommandOpcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
XY_COPY_BLT *genCmdCast<XY_COPY_BLT *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<XY_COPY_BLT *>(buffer);
|
||||
|
||||
return XY_COPY_BLT::INSTRUCTIONTARGET_OPCODE_OPCODE == pCmd->TheStructure.Common.InstructionTarget_Opcode &&
|
||||
XY_COPY_BLT::CLIENT_2D_PROCESSOR == pCmd->TheStructure.Common.Client
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
size_t CmdParse<T>::getCommandLength(void *cmd) {
|
||||
{
|
||||
auto pCmd = genCmdCast<STATE_BASE_ADDRESS *>(cmd);
|
||||
if (pCmd)
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<PIPE_CONTROL *>(cmd);
|
||||
if (pCmd)
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_ARB_CHECK *>(cmd);
|
||||
if (pCmd)
|
||||
return SIZE32(*pCmd);
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_ATOMIC *>(cmd);
|
||||
if (pCmd)
|
||||
return sizeof(MI_ATOMIC) / sizeof(uint32_t);
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_BATCH_BUFFER_END *>(cmd);
|
||||
if (pCmd)
|
||||
return SIZE32(*pCmd);
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_BATCH_BUFFER_START *>(cmd);
|
||||
if (pCmd)
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_LOAD_REGISTER_IMM *>(cmd);
|
||||
if (pCmd)
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_LOAD_REGISTER_MEM *>(cmd);
|
||||
if (pCmd)
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_STORE_REGISTER_MEM *>(cmd);
|
||||
if (pCmd)
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_NOOP *>(cmd);
|
||||
if (pCmd)
|
||||
return SIZE32(*pCmd);
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<PIPELINE_SELECT *>(cmd);
|
||||
if (pCmd)
|
||||
return SIZE32(*pCmd);
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_REPORT_PERF_COUNT *>(cmd);
|
||||
if (pCmd)
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_MATH *>(cmd);
|
||||
if (pCmd)
|
||||
return pCmd->DW0.BitField.DwordLength + 2;
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_LOAD_REGISTER_REG *>(cmd);
|
||||
if (pCmd)
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_SEMAPHORE_WAIT *>(cmd);
|
||||
if (pCmd)
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_STORE_DATA_IMM *>(cmd);
|
||||
if (pCmd)
|
||||
return pCmd->TheStructure.Common.DwordLength + 3;
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_FLUSH_DW *>(cmd);
|
||||
if (pCmd)
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<XY_COPY_BLT *>(cmd);
|
||||
if (pCmd)
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
|
||||
auto commandLengthHwSpecific = getCommandLengthHwSpecific(cmd);
|
||||
|
||||
if (commandLengthHwSpecific != 0) {
|
||||
return commandLengthHwSpecific;
|
||||
}
|
||||
return getAdditionalCommandLength(cmd);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
const char *CmdParse<T>::getCommandName(void *cmd) {
|
||||
#define RETURN_NAME_IF(CMD_NAME) \
|
||||
if (nullptr != genCmdCast<CMD_NAME *>(cmd)) \
|
||||
return #CMD_NAME;
|
||||
|
||||
RETURN_NAME_IF(STATE_BASE_ADDRESS);
|
||||
RETURN_NAME_IF(PIPE_CONTROL);
|
||||
RETURN_NAME_IF(MI_ARB_CHECK);
|
||||
RETURN_NAME_IF(MI_ATOMIC);
|
||||
RETURN_NAME_IF(MI_BATCH_BUFFER_END);
|
||||
RETURN_NAME_IF(MI_BATCH_BUFFER_START);
|
||||
RETURN_NAME_IF(MI_LOAD_REGISTER_IMM);
|
||||
RETURN_NAME_IF(MI_LOAD_REGISTER_MEM);
|
||||
RETURN_NAME_IF(MI_STORE_REGISTER_MEM);
|
||||
RETURN_NAME_IF(MI_NOOP);
|
||||
RETURN_NAME_IF(PIPELINE_SELECT);
|
||||
RETURN_NAME_IF(MI_REPORT_PERF_COUNT);
|
||||
RETURN_NAME_IF(MI_MATH);
|
||||
RETURN_NAME_IF(MI_LOAD_REGISTER_REG);
|
||||
RETURN_NAME_IF(MI_SEMAPHORE_WAIT);
|
||||
RETURN_NAME_IF(MI_STORE_DATA_IMM);
|
||||
RETURN_NAME_IF(MI_FLUSH_DW);
|
||||
RETURN_NAME_IF(XY_COPY_BLT);
|
||||
|
||||
#undef RETURN_NAME_IF
|
||||
|
||||
auto commandNameHwSpecific = getCommandNameHwSpecific(cmd);
|
||||
if (strcmp(commandNameHwSpecific, "UNKNOWN") != 0) {
|
||||
return commandNameHwSpecific;
|
||||
}
|
||||
|
||||
return getAdditionalCommandName(cmd);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
size_t CmdParse<T>::getAdditionalCommandLength(void *cmd) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
const char *CmdParse<T>::getAdditionalCommandName(void *cmd) {
|
||||
return "UNKNOWN";
|
||||
}
|
||||
16
shared/test/unit_test/cmd_parse/cmd_parse_base_mi_arb.inl
Normal file
16
shared/test/unit_test/cmd_parse/cmd_parse_base_mi_arb.inl
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
template <>
|
||||
MI_ARB_CHECK *genCmdCast<MI_ARB_CHECK *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<MI_ARB_CHECK *>(buffer);
|
||||
|
||||
return MI_ARB_CHECK::MI_INSTRUCTION_TYPE_MI_INSTRUCTION == pCmd->TheStructure.Common.MiInstructionType &&
|
||||
MI_ARB_CHECK::MI_INSTRUCTION_OPCODE_MI_ARB_CHECK == pCmd->TheStructure.Common.MiInstructionOpcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
23
shared/test/unit_test/cmd_parse/cmd_parse_compute_mode.inl
Normal file
23
shared/test/unit_test/cmd_parse/cmd_parse_compute_mode.inl
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
// clang-format off
|
||||
using namespace NEO;
|
||||
using STATE_COMPUTE_MODE = GenStruct::STATE_COMPUTE_MODE;
|
||||
// clang-format on
|
||||
|
||||
template <>
|
||||
STATE_COMPUTE_MODE *genCmdCast<STATE_COMPUTE_MODE *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<STATE_COMPUTE_MODE *>(buffer);
|
||||
|
||||
return STATE_COMPUTE_MODE::COMMAND_TYPE_GFXPIPE == pCmd->TheStructure.Common.CommandType &&
|
||||
STATE_COMPUTE_MODE::COMMAND_SUBTYPE_GFXPIPE_COMMON == pCmd->TheStructure.Common.CommandSubtype &&
|
||||
STATE_COMPUTE_MODE::_3D_COMMAND_OPCODE_GFXPIPE_NONPIPELINED == pCmd->TheStructure.Common._3DCommandOpcode &&
|
||||
STATE_COMPUTE_MODE::_3D_COMMAND_SUB_OPCODE_STATE_COMPUTE_MODE == pCmd->TheStructure.Common._3DCommandSubOpcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
162
shared/test/unit_test/cmd_parse/cmd_parse_gpgpu_walker.inl
Normal file
162
shared/test/unit_test/cmd_parse/cmd_parse_gpgpu_walker.inl
Normal file
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
// clang-format off
|
||||
using namespace NEO;
|
||||
using GPGPU_WALKER = GenStruct::GPGPU_WALKER;
|
||||
using MEDIA_INTERFACE_DESCRIPTOR_LOAD = GenStruct::MEDIA_INTERFACE_DESCRIPTOR_LOAD;
|
||||
using MEDIA_STATE_FLUSH = GenStruct::MEDIA_STATE_FLUSH;
|
||||
using MEDIA_VFE_STATE = GenStruct::MEDIA_VFE_STATE;
|
||||
// clang-format on
|
||||
|
||||
template <>
|
||||
GPGPU_WALKER *genCmdCast<GPGPU_WALKER *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<GPGPU_WALKER *>(buffer);
|
||||
|
||||
return GPGPU_WALKER::COMMAND_TYPE_GFXPIPE == pCmd->TheStructure.Common.CommandType &&
|
||||
GPGPU_WALKER::PIPELINE_MEDIA == pCmd->TheStructure.Common.Pipeline &&
|
||||
GPGPU_WALKER::MEDIA_COMMAND_OPCODE_GPGPU_WALKER == pCmd->TheStructure.Common.MediaCommandOpcode &&
|
||||
GPGPU_WALKER::SUBOPCODE_GPGPU_WALKER_SUBOP == pCmd->TheStructure.Common.Subopcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
MEDIA_INTERFACE_DESCRIPTOR_LOAD *genCmdCast<MEDIA_INTERFACE_DESCRIPTOR_LOAD *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<MEDIA_INTERFACE_DESCRIPTOR_LOAD *>(buffer);
|
||||
|
||||
return MEDIA_INTERFACE_DESCRIPTOR_LOAD::COMMAND_TYPE_GFXPIPE == pCmd->TheStructure.Common.CommandType &&
|
||||
MEDIA_INTERFACE_DESCRIPTOR_LOAD::PIPELINE_MEDIA == pCmd->TheStructure.Common.Pipeline &&
|
||||
MEDIA_INTERFACE_DESCRIPTOR_LOAD::MEDIA_COMMAND_OPCODE_MEDIA_INTERFACE_DESCRIPTOR_LOAD == pCmd->TheStructure.Common.MediaCommandOpcode &&
|
||||
MEDIA_INTERFACE_DESCRIPTOR_LOAD::SUBOPCODE_MEDIA_INTERFACE_DESCRIPTOR_LOAD_SUBOP == pCmd->TheStructure.Common.Subopcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
MEDIA_VFE_STATE *genCmdCast<MEDIA_VFE_STATE *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<MEDIA_VFE_STATE *>(buffer);
|
||||
|
||||
return MEDIA_VFE_STATE::COMMAND_TYPE_GFXPIPE == pCmd->TheStructure.Common.CommandType &&
|
||||
MEDIA_VFE_STATE::PIPELINE_MEDIA == pCmd->TheStructure.Common.Pipeline &&
|
||||
MEDIA_VFE_STATE::MEDIA_COMMAND_OPCODE_MEDIA_VFE_STATE == pCmd->TheStructure.Common.MediaCommandOpcode &&
|
||||
MEDIA_VFE_STATE::SUBOPCODE_MEDIA_VFE_STATE_SUBOP == pCmd->TheStructure.Common.Subopcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
MEDIA_STATE_FLUSH *genCmdCast<MEDIA_STATE_FLUSH *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<MEDIA_STATE_FLUSH *>(buffer);
|
||||
|
||||
return MEDIA_STATE_FLUSH::COMMAND_TYPE_GFXPIPE == pCmd->TheStructure.Common.CommandType &&
|
||||
MEDIA_STATE_FLUSH::PIPELINE_MEDIA == pCmd->TheStructure.Common.Pipeline &&
|
||||
MEDIA_STATE_FLUSH::MEDIA_COMMAND_OPCODE_MEDIA_STATE_FLUSH == pCmd->TheStructure.Common.MediaCommandOpcode &&
|
||||
MEDIA_STATE_FLUSH::SUBOPCODE_MEDIA_STATE_FLUSH_SUBOP == pCmd->TheStructure.Common.Subopcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool CmdParse<T>::parseCommandBuffer(GenCmdList &cmds, void *buffer, size_t length) {
|
||||
if (!buffer || length % sizeof(uint32_t)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void *bufferEnd = reinterpret_cast<uint8_t *>(buffer) + length;
|
||||
while (buffer < bufferEnd) {
|
||||
size_t length = getCommandLength(buffer);
|
||||
if (!length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
cmds.push_back(buffer);
|
||||
|
||||
buffer = reinterpret_cast<uint32_t *>(buffer) + length;
|
||||
}
|
||||
|
||||
return buffer == bufferEnd;
|
||||
}
|
||||
|
||||
// MIDL should have a MSF between it and a previous walker
|
||||
template <>
|
||||
template <>
|
||||
void CmdParse<GenGfxFamily>::validateCommand<MEDIA_INTERFACE_DESCRIPTOR_LOAD *>(GenCmdList::iterator itorBegin, GenCmdList::iterator itorEnd) {
|
||||
auto itorCurrent = itorBegin;
|
||||
auto itorWalker = itorEnd;
|
||||
|
||||
// Find last GPGPU_WALKER prior to itorCmd
|
||||
while (itorCurrent != itorEnd) {
|
||||
if (genCmdCast<GPGPU_WALKER *>(*itorCurrent)) {
|
||||
itorWalker = itorCurrent;
|
||||
}
|
||||
|
||||
++itorCurrent;
|
||||
}
|
||||
|
||||
// If we don't find a GPGPU_WALKER, assume the beginning of a cmd list
|
||||
itorWalker = itorWalker == itorEnd
|
||||
? itorBegin
|
||||
: itorWalker;
|
||||
|
||||
// Look for MEDIA_STATE_FLUSH between last GPGPU_WALKER and MIDL.
|
||||
auto itorMSF = itorEnd;
|
||||
|
||||
itorCurrent = itorWalker;
|
||||
++itorCurrent;
|
||||
while (itorCurrent != itorEnd) {
|
||||
if (genCmdCast<MEDIA_STATE_FLUSH *>(*itorCurrent)) {
|
||||
itorMSF = itorCurrent;
|
||||
break;
|
||||
}
|
||||
++itorCurrent;
|
||||
}
|
||||
|
||||
ASSERT_FALSE(itorMSF == itorEnd) << "A MEDIA_STATE_FLUSH is required before a MEDIA_INTERFACE_DESCRIPTOR_LOAD.";
|
||||
}
|
||||
|
||||
template <>
|
||||
template <>
|
||||
void CmdParse<GenGfxFamily>::validateCommand<STATE_BASE_ADDRESS *>(GenCmdList::iterator itorBegin, GenCmdList::iterator itorEnd) {
|
||||
}
|
||||
|
||||
// MVFES should have a stalling PC between it and a previous walker
|
||||
template <>
|
||||
template <>
|
||||
void CmdParse<GenGfxFamily>::validateCommand<MEDIA_VFE_STATE *>(GenCmdList::iterator itorBegin, GenCmdList::iterator itorEnd) {
|
||||
auto itorCurrent = itorBegin;
|
||||
auto itorWalker = itorEnd;
|
||||
|
||||
// Find last GPGPU_WALKER prior to itorCmd
|
||||
while (itorCurrent != itorEnd) {
|
||||
if (genCmdCast<GPGPU_WALKER *>(*itorCurrent)) {
|
||||
itorWalker = itorCurrent;
|
||||
}
|
||||
|
||||
++itorCurrent;
|
||||
}
|
||||
|
||||
// If we don't find a GPGPU_WALKER, assume the beginning of a cmd list
|
||||
itorWalker = itorWalker == itorEnd
|
||||
? itorBegin
|
||||
: itorWalker;
|
||||
|
||||
// Look for PIPE_CONTROL between last GPGPU_WALKER and MVFES.
|
||||
itorCurrent = itorWalker;
|
||||
++itorCurrent;
|
||||
while (itorCurrent != itorEnd) {
|
||||
if (genCmdCast<PIPE_CONTROL *>(*itorCurrent)) {
|
||||
auto pPC = genCmdCast<PIPE_CONTROL *>(*itorCurrent);
|
||||
if (pPC->getCommandStreamerStallEnable()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
++itorCurrent;
|
||||
}
|
||||
|
||||
ASSERT_TRUE(false) << "A PIPE_CONTROL w/ CS stall is required before a MEDIA_VFE_STATE.";
|
||||
}
|
||||
16
shared/test/unit_test/cmd_parse/cmd_parse_mi_arb.inl
Normal file
16
shared/test/unit_test/cmd_parse/cmd_parse_mi_arb.inl
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
template <>
|
||||
MI_ARB_CHECK *genCmdCast<MI_ARB_CHECK *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<MI_ARB_CHECK *>(buffer);
|
||||
|
||||
return MI_ARB_CHECK::COMMAND_TYPE_MI_COMMAND == pCmd->TheStructure.Common.CommandType &&
|
||||
MI_ARB_CHECK::MI_COMMAND_OPCODE_MI_ARB_CHECK == pCmd->TheStructure.Common.MiCommandOpcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
36
shared/test/unit_test/cmd_parse/cmd_parse_sip.inl
Normal file
36
shared/test/unit_test/cmd_parse/cmd_parse_sip.inl
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
// clang-format off
|
||||
using namespace NEO;
|
||||
using GPGPU_CSR_BASE_ADDRESS = GenStruct::GPGPU_CSR_BASE_ADDRESS;
|
||||
using STATE_SIP = GenStruct::STATE_SIP;
|
||||
// clang-format on
|
||||
|
||||
template <>
|
||||
GPGPU_CSR_BASE_ADDRESS *genCmdCast<GPGPU_CSR_BASE_ADDRESS *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<GPGPU_CSR_BASE_ADDRESS *>(buffer);
|
||||
|
||||
return GPGPU_CSR_BASE_ADDRESS::COMMAND_TYPE_GFXPIPE == pCmd->TheStructure.Common.CommandType &&
|
||||
GPGPU_CSR_BASE_ADDRESS::COMMAND_SUBTYPE_GFXPIPE_COMMON == pCmd->TheStructure.Common.CommandSubtype &&
|
||||
GPGPU_CSR_BASE_ADDRESS::_3D_COMMAND_OPCODE_GFXPIPE_NONPIPELINED == pCmd->TheStructure.Common._3DCommandOpcode &&
|
||||
GPGPU_CSR_BASE_ADDRESS::_3D_COMMAND_SUB_OPCODE_GPGPU_CSR_BASE_ADDRESS == pCmd->TheStructure.Common._3DCommandSubOpcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
STATE_SIP *genCmdCast<STATE_SIP *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<STATE_SIP *>(buffer);
|
||||
|
||||
return STATE_SIP::COMMAND_TYPE_GFXPIPE == pCmd->TheStructure.Common.CommandType &&
|
||||
STATE_SIP::COMMAND_SUBTYPE_GFXPIPE_COMMON == pCmd->TheStructure.Common.CommandSubtype &&
|
||||
STATE_SIP::_3D_COMMAND_OPCODE_GFXPIPE_NONPIPELINED == pCmd->TheStructure.Common._3DCommandOpcode &&
|
||||
STATE_SIP::_3D_COMMAND_SUB_OPCODE_STATE_SIP == pCmd->TheStructure.Common._3DCommandSubOpcode
|
||||
? pCmd
|
||||
: nullptr;
|
||||
}
|
||||
103
shared/test/unit_test/cmd_parse/gen_cmd_parse.h
Normal file
103
shared/test/unit_test/cmd_parse/gen_cmd_parse.h
Normal file
@@ -0,0 +1,103 @@
|
||||
/*
|
||||
* Copyright (C) 2017-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/helpers/hw_cmds.h"
|
||||
|
||||
#include <list>
|
||||
#include <vector>
|
||||
|
||||
typedef std::list<void *> GenCmdList;
|
||||
|
||||
template <typename Type>
|
||||
Type genCmdCast(void *cmd);
|
||||
|
||||
template <typename Type>
|
||||
static inline GenCmdList::iterator find(GenCmdList::iterator itorStart, GenCmdList::const_iterator itorEnd) {
|
||||
GenCmdList::iterator itor = itorStart;
|
||||
while (itor != itorEnd) {
|
||||
if (genCmdCast<Type>(*itor))
|
||||
break;
|
||||
++itor;
|
||||
}
|
||||
return itor;
|
||||
}
|
||||
|
||||
template <typename CommandToFind>
|
||||
static inline std::vector<GenCmdList::iterator> findAll(GenCmdList::iterator commandListStart, GenCmdList::const_iterator commandListEnd) {
|
||||
std::vector<GenCmdList::iterator> matchedCommands;
|
||||
GenCmdList::iterator currentCommand = commandListStart;
|
||||
while (currentCommand != commandListEnd) {
|
||||
if (genCmdCast<CommandToFind>(*currentCommand)) {
|
||||
matchedCommands.push_back(currentCommand);
|
||||
}
|
||||
++currentCommand;
|
||||
}
|
||||
return matchedCommands;
|
||||
}
|
||||
|
||||
template <typename FamilyType>
|
||||
static inline GenCmdList::iterator findMmio(GenCmdList::iterator itorStart, GenCmdList::const_iterator itorEnd, uint32_t regOffset) {
|
||||
GenCmdList::iterator itor = itorStart;
|
||||
while (itor != itorEnd) {
|
||||
auto cmd = genCmdCast<typename FamilyType::MI_LOAD_REGISTER_IMM *>(*itor);
|
||||
if (cmd && cmd->getRegisterOffset() == regOffset)
|
||||
break;
|
||||
++itor;
|
||||
}
|
||||
return itor;
|
||||
}
|
||||
|
||||
template <typename FamilyType>
|
||||
static inline size_t countMmio(GenCmdList::iterator itorStart, GenCmdList::const_iterator itorEnd, uint32_t regOffset) {
|
||||
size_t count = 0;
|
||||
GenCmdList::iterator itor = itorStart;
|
||||
while (itor != itorEnd) {
|
||||
auto cmd = genCmdCast<typename FamilyType::MI_LOAD_REGISTER_IMM *>(*itor);
|
||||
if (cmd && cmd->getRegisterOffset() == regOffset) {
|
||||
++count;
|
||||
}
|
||||
++itor;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
template <typename FamilyType>
|
||||
static inline typename FamilyType::MI_LOAD_REGISTER_IMM *findMmioCmd(GenCmdList::iterator itorStart, GenCmdList::const_iterator itorEnd, uint32_t regOffset) {
|
||||
auto itor = findMmio<FamilyType>(itorStart, itorEnd, regOffset);
|
||||
if (itor == itorEnd) {
|
||||
return nullptr;
|
||||
}
|
||||
return reinterpret_cast<typename FamilyType::MI_LOAD_REGISTER_IMM *>(*itor);
|
||||
}
|
||||
|
||||
template <typename Type>
|
||||
static inline GenCmdList::reverse_iterator reverse_find(GenCmdList::reverse_iterator itorStart, GenCmdList::const_reverse_iterator itorEnd) {
|
||||
GenCmdList::reverse_iterator itor = itorStart;
|
||||
while (itor != itorEnd) {
|
||||
if (genCmdCast<Type>(*itor))
|
||||
break;
|
||||
++itor;
|
||||
}
|
||||
return itor;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
struct CmdParse : public T {
|
||||
static size_t getCommandLength(void *cmd);
|
||||
static size_t getCommandLengthHwSpecific(void *cmd);
|
||||
static size_t getAdditionalCommandLength(void *cmd);
|
||||
|
||||
static bool parseCommandBuffer(GenCmdList &cmds, void *buffer, size_t length);
|
||||
|
||||
template <typename CmdType>
|
||||
static void validateCommand(GenCmdList::iterator itorBegin, GenCmdList::iterator itorEnd);
|
||||
|
||||
static const char *getCommandName(void *cmd);
|
||||
static const char *getCommandNameHwSpecific(void *cmd);
|
||||
static const char *getAdditionalCommandName(void *cmd);
|
||||
};
|
||||
231
shared/test/unit_test/cmd_parse/hw_parse.h
Normal file
231
shared/test/unit_test/cmd_parse/hw_parse.h
Normal file
@@ -0,0 +1,231 @@
|
||||
/*
|
||||
* Copyright (C) 2017-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/command_stream/command_stream_receiver.h"
|
||||
#include "shared/source/command_stream/linear_stream.h"
|
||||
#include "shared/source/helpers/pipeline_select_helper.h"
|
||||
#include "shared/source/helpers/ptr_math.h"
|
||||
#include "shared/test/unit_test/cmd_parse/gen_cmd_parse.h"
|
||||
#include "shared/test/unit_test/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 {
|
||||
|
||||
struct HardwareParse {
|
||||
HardwareParse() {
|
||||
itorMediaInterfaceDescriptorLoad = cmdList.end();
|
||||
itorMediaVfeState = cmdList.end();
|
||||
itorPipelineSelect = cmdList.end();
|
||||
itorStateBaseAddress = cmdList.end();
|
||||
itorWalker = cmdList.end();
|
||||
itorGpgpuCsrBaseAddress = cmdList.end();
|
||||
}
|
||||
|
||||
void SetUp() {
|
||||
}
|
||||
|
||||
void TearDown() {
|
||||
cmdList.clear();
|
||||
lriList.clear();
|
||||
pipeControlList.clear();
|
||||
}
|
||||
|
||||
template <typename CmdType>
|
||||
GenCmdList getCommandsList() {
|
||||
GenCmdList list;
|
||||
for (auto it = cmdList.begin(); it != cmdList.end(); it++) {
|
||||
auto cmd = genCmdCast<CmdType *>(*it);
|
||||
if (cmd) {
|
||||
list.push_back(*it);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
template <typename FamilyType>
|
||||
void findCsrBaseAddress();
|
||||
|
||||
template <typename FamilyType>
|
||||
void findHardwareCommands();
|
||||
|
||||
template <typename FamilyType>
|
||||
void findHardwareCommands(IndirectHeap *dsh);
|
||||
|
||||
template <typename FamilyType>
|
||||
void parseCommands(NEO::LinearStream &commandStream, size_t startOffset = 0) {
|
||||
ASSERT_LE(startOffset, commandStream.getUsed());
|
||||
auto sizeToParse = commandStream.getUsed() - startOffset;
|
||||
ASSERT_TRUE(FamilyType::PARSE::parseCommandBuffer(
|
||||
cmdList,
|
||||
ptrOffset(commandStream.getCpuBase(), startOffset),
|
||||
sizeToParse));
|
||||
}
|
||||
|
||||
template <typename FamilyType>
|
||||
void parseCommands(NEO::CommandQueue &commandQueue) {
|
||||
auto &commandStreamReceiver = commandQueue.getGpgpuCommandStreamReceiver();
|
||||
auto &commandStreamCSR = commandStreamReceiver.getCS();
|
||||
|
||||
parseCommands<FamilyType>(commandStreamCSR, startCSRCS);
|
||||
startCSRCS = commandStreamCSR.getUsed();
|
||||
|
||||
auto &commandStream = commandQueue.getCS(1024);
|
||||
if (previousCS != &commandStream) {
|
||||
startCS = 0;
|
||||
}
|
||||
parseCommands<FamilyType>(commandStream, startCS);
|
||||
startCS = commandStream.getUsed();
|
||||
previousCS = &commandStream;
|
||||
|
||||
sizeUsed = commandStream.getUsed();
|
||||
findHardwareCommands<FamilyType>(&commandStreamReceiver.getIndirectHeap(IndirectHeap::DYNAMIC_STATE, 0));
|
||||
}
|
||||
|
||||
template <typename FamilyType>
|
||||
const typename FamilyType::RENDER_SURFACE_STATE &getSurfaceState(IndirectHeap *ssh, uint32_t index) {
|
||||
typedef typename FamilyType::BINDING_TABLE_STATE BINDING_TABLE_STATE;
|
||||
typedef typename FamilyType::INTERFACE_DESCRIPTOR_DATA INTERFACE_DESCRIPTOR_DATA;
|
||||
typedef typename FamilyType::RENDER_SURFACE_STATE RENDER_SURFACE_STATE;
|
||||
typedef typename FamilyType::STATE_BASE_ADDRESS STATE_BASE_ADDRESS;
|
||||
|
||||
const auto &interfaceDescriptorData = *(INTERFACE_DESCRIPTOR_DATA *)cmdInterfaceDescriptorData;
|
||||
|
||||
auto cmdSBA = (STATE_BASE_ADDRESS *)cmdStateBaseAddress;
|
||||
auto surfaceStateHeap = cmdSBA->getSurfaceStateBaseAddress();
|
||||
if (ssh && (ssh->getHeapGpuBase() == surfaceStateHeap)) {
|
||||
surfaceStateHeap = reinterpret_cast<uint64_t>(ssh->getCpuBase());
|
||||
}
|
||||
EXPECT_NE(0u, surfaceStateHeap);
|
||||
|
||||
auto bindingTablePointer = interfaceDescriptorData.getBindingTablePointer();
|
||||
|
||||
const auto &bindingTableState = reinterpret_cast<BINDING_TABLE_STATE *>(surfaceStateHeap + bindingTablePointer)[index];
|
||||
auto surfaceStatePointer = bindingTableState.getSurfaceStatePointer();
|
||||
|
||||
return *(RENDER_SURFACE_STATE *)(surfaceStateHeap + surfaceStatePointer);
|
||||
}
|
||||
|
||||
template <typename FamilyType>
|
||||
const typename FamilyType::SAMPLER_STATE &getSamplerState(uint32_t index) {
|
||||
typedef typename FamilyType::INTERFACE_DESCRIPTOR_DATA INTERFACE_DESCRIPTOR_DATA;
|
||||
typedef typename FamilyType::SAMPLER_STATE SAMPLER_STATE;
|
||||
typedef typename FamilyType::STATE_BASE_ADDRESS STATE_BASE_ADDRESS;
|
||||
|
||||
const auto &interfaceDescriptorData = *(INTERFACE_DESCRIPTOR_DATA *)cmdInterfaceDescriptorData;
|
||||
|
||||
auto cmdSBA = (STATE_BASE_ADDRESS *)cmdStateBaseAddress;
|
||||
auto dynamicStateHeap = cmdSBA->getDynamicStateBaseAddress();
|
||||
EXPECT_NE(0, dynamicStateHeap);
|
||||
|
||||
const auto samplerState = reinterpret_cast<SAMPLER_STATE *>(dynamicStateHeap + interfaceDescriptorData.getSamplerStatePointer());
|
||||
return samplerState[index];
|
||||
}
|
||||
|
||||
template <typename FamilyType>
|
||||
const void *getStatelessArgumentPointer(const Kernel &kernel, uint32_t indexArg, IndirectHeap &ioh);
|
||||
|
||||
template <typename CmdType>
|
||||
CmdType *getCommand(GenCmdList::iterator itorStart, GenCmdList::iterator itorEnd) {
|
||||
auto itorCmd = find<CmdType *>(itorStart, itorEnd);
|
||||
return itorCmd != cmdList.end()
|
||||
? genCmdCast<CmdType *>(*itorCmd)
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
template <typename CmdType>
|
||||
CmdType *getCommand() {
|
||||
return getCommand<CmdType>(cmdList.begin(), cmdList.end());
|
||||
}
|
||||
|
||||
template <typename FamilyType>
|
||||
int getNumberOfPipelineSelectsThatEnablePipelineSelect() {
|
||||
typedef typename FamilyType::PIPELINE_SELECT PIPELINE_SELECT;
|
||||
int numberOfGpgpuSelects = 0;
|
||||
int numberOf3dSelects = 0;
|
||||
auto itorCmd = find<PIPELINE_SELECT *>(cmdList.begin(), cmdList.end());
|
||||
while (itorCmd != cmdList.end()) {
|
||||
auto cmd = getCommand<PIPELINE_SELECT>(itorCmd, cmdList.end());
|
||||
if (cmd->getPipelineSelection() == PIPELINE_SELECT::PIPELINE_SELECTION_GPGPU &&
|
||||
pipelineSelectEnablePipelineSelectMaskBits == (pipelineSelectEnablePipelineSelectMaskBits & cmd->getMaskBits())) {
|
||||
numberOfGpgpuSelects++;
|
||||
}
|
||||
if (cmd->getPipelineSelection() == PIPELINE_SELECT::PIPELINE_SELECTION_3D &&
|
||||
pipelineSelectEnablePipelineSelectMaskBits == (pipelineSelectEnablePipelineSelectMaskBits & cmd->getMaskBits())) {
|
||||
numberOf3dSelects++;
|
||||
}
|
||||
itorCmd = find<PIPELINE_SELECT *>(++itorCmd, cmdList.end());
|
||||
}
|
||||
auto &hwHelper = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily);
|
||||
if (hwHelper.is3DPipelineSelectWARequired(*defaultHwInfo)) {
|
||||
auto maximalNumberOf3dSelectsRequired = 2;
|
||||
EXPECT_LE(numberOf3dSelects, maximalNumberOf3dSelectsRequired);
|
||||
EXPECT_EQ(numberOf3dSelects, numberOfGpgpuSelects);
|
||||
auto numberOfGpgpuSelectsAddedByWa = numberOf3dSelects - 1;
|
||||
numberOfGpgpuSelects -= numberOfGpgpuSelectsAddedByWa;
|
||||
} else {
|
||||
EXPECT_EQ(0, numberOf3dSelects);
|
||||
}
|
||||
return numberOfGpgpuSelects;
|
||||
}
|
||||
|
||||
template <typename CmdType>
|
||||
uint32_t getCommandCount() {
|
||||
GenCmdList::iterator cmdItor = cmdList.begin();
|
||||
uint32_t cmdCount = 0;
|
||||
|
||||
do {
|
||||
cmdItor = find<CmdType *>(cmdItor, cmdList.end());
|
||||
if (cmdItor != cmdList.end()) {
|
||||
++cmdCount;
|
||||
++cmdItor;
|
||||
}
|
||||
} while (cmdItor != cmdList.end());
|
||||
|
||||
return cmdCount;
|
||||
}
|
||||
|
||||
template <typename FamilyType>
|
||||
static const char *getCommandName(void *cmd) {
|
||||
return FamilyType::PARSE::getCommandName(cmd);
|
||||
}
|
||||
|
||||
// The starting point of parsing commandBuffers. This is important
|
||||
// because as buffers get reused, we only want to parse the deltas.
|
||||
LinearStream *previousCS = nullptr;
|
||||
size_t startCS = 0u;
|
||||
size_t startCSRCS = 0u;
|
||||
|
||||
size_t sizeUsed = 0u;
|
||||
GenCmdList cmdList;
|
||||
GenCmdList lriList;
|
||||
GenCmdList pipeControlList;
|
||||
GenCmdList::iterator itorMediaInterfaceDescriptorLoad;
|
||||
GenCmdList::iterator itorMediaVfeState;
|
||||
GenCmdList::iterator itorPipelineSelect;
|
||||
GenCmdList::iterator itorStateBaseAddress;
|
||||
GenCmdList::iterator itorWalker;
|
||||
GenCmdList::iterator itorBBStartAfterWalker;
|
||||
GenCmdList::iterator itorGpgpuCsrBaseAddress;
|
||||
|
||||
void *cmdInterfaceDescriptorData = nullptr;
|
||||
void *cmdMediaInterfaceDescriptorLoad = nullptr;
|
||||
void *cmdMediaVfeState = nullptr;
|
||||
void *cmdPipelineSelect = nullptr;
|
||||
void *cmdStateBaseAddress = nullptr;
|
||||
void *cmdWalker = nullptr;
|
||||
void *cmdBBStartAfterWalker = nullptr;
|
||||
void *cmdGpgpuCsrBaseAddress = nullptr;
|
||||
|
||||
bool parsePipeControl = false;
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
127
shared/test/unit_test/cmd_parse/hw_parse.inl
Normal file
127
shared/test/unit_test/cmd_parse/hw_parse.inl
Normal file
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
template <typename FamilyType>
|
||||
void HardwareParse::findHardwareCommands(IndirectHeap *dsh) {
|
||||
using GPGPU_WALKER = typename FamilyType::GPGPU_WALKER;
|
||||
using PIPELINE_SELECT = typename FamilyType::PIPELINE_SELECT;
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
using MEDIA_INTERFACE_DESCRIPTOR_LOAD = typename FamilyType::MEDIA_INTERFACE_DESCRIPTOR_LOAD;
|
||||
using MEDIA_VFE_STATE = typename FamilyType::MEDIA_VFE_STATE;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START;
|
||||
using MI_LOAD_REGISTER_IMM = typename FamilyType::MI_LOAD_REGISTER_IMM;
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
|
||||
itorWalker = find<GPGPU_WALKER *>(cmdList.begin(), cmdList.end());
|
||||
if (itorWalker != cmdList.end()) {
|
||||
cmdWalker = *itorWalker;
|
||||
}
|
||||
|
||||
itorBBStartAfterWalker = find<MI_BATCH_BUFFER_START *>(itorWalker, cmdList.end());
|
||||
if (itorBBStartAfterWalker != cmdList.end()) {
|
||||
cmdBBStartAfterWalker = *itorBBStartAfterWalker;
|
||||
}
|
||||
for (auto it = cmdList.begin(); it != cmdList.end(); it++) {
|
||||
auto lri = genCmdCast<MI_LOAD_REGISTER_IMM *>(*it);
|
||||
if (lri) {
|
||||
lriList.push_back(*it);
|
||||
}
|
||||
}
|
||||
if (parsePipeControl) {
|
||||
for (auto it = cmdList.begin(); it != cmdList.end(); it++) {
|
||||
auto pipeControl = genCmdCast<PIPE_CONTROL *>(*it);
|
||||
if (pipeControl) {
|
||||
pipeControlList.push_back(*it);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MEDIA_INTERFACE_DESCRIPTOR_LOAD *cmdMIDL = nullptr;
|
||||
itorMediaInterfaceDescriptorLoad = find<MEDIA_INTERFACE_DESCRIPTOR_LOAD *>(cmdList.begin(), itorWalker);
|
||||
if (itorMediaInterfaceDescriptorLoad != itorWalker) {
|
||||
cmdMIDL = (MEDIA_INTERFACE_DESCRIPTOR_LOAD *)*itorMediaInterfaceDescriptorLoad;
|
||||
cmdMediaInterfaceDescriptorLoad = *itorMediaInterfaceDescriptorLoad;
|
||||
}
|
||||
|
||||
itorPipelineSelect = find<PIPELINE_SELECT *>(cmdList.begin(), itorWalker);
|
||||
if (itorPipelineSelect != itorWalker) {
|
||||
cmdPipelineSelect = *itorPipelineSelect;
|
||||
}
|
||||
|
||||
itorMediaVfeState = find<MEDIA_VFE_STATE *>(itorPipelineSelect, itorWalker);
|
||||
if (itorMediaVfeState != itorWalker) {
|
||||
cmdMediaVfeState = *itorMediaVfeState;
|
||||
}
|
||||
|
||||
STATE_BASE_ADDRESS *cmdSBA = nullptr;
|
||||
uint64_t dynamicStateHeap = 0;
|
||||
itorStateBaseAddress = find<STATE_BASE_ADDRESS *>(cmdList.begin(), itorWalker);
|
||||
if (itorStateBaseAddress != itorWalker) {
|
||||
cmdSBA = (STATE_BASE_ADDRESS *)*itorStateBaseAddress;
|
||||
cmdStateBaseAddress = *itorStateBaseAddress;
|
||||
|
||||
// Extract the dynamicStateHeap
|
||||
dynamicStateHeap = cmdSBA->getDynamicStateBaseAddress();
|
||||
if (dsh && (dsh->getHeapGpuBase() == dynamicStateHeap)) {
|
||||
dynamicStateHeap = reinterpret_cast<uint64_t>(dsh->getCpuBase());
|
||||
}
|
||||
ASSERT_NE(0u, dynamicStateHeap);
|
||||
}
|
||||
|
||||
// interfaceDescriptorData should be located within dynamicStateHeap
|
||||
if (cmdMIDL && cmdSBA) {
|
||||
auto iddStart = cmdMIDL->getInterfaceDescriptorDataStartAddress();
|
||||
auto iddEnd = iddStart + cmdMIDL->getInterfaceDescriptorTotalLength();
|
||||
ASSERT_LE(iddEnd, cmdSBA->getDynamicStateBufferSize() * MemoryConstants::pageSize);
|
||||
|
||||
// Extract the interfaceDescriptorData
|
||||
cmdInterfaceDescriptorData = (INTERFACE_DESCRIPTOR_DATA *)(dynamicStateHeap + iddStart);
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
typedef typename FamilyType::STATE_BASE_ADDRESS STATE_BASE_ADDRESS;
|
||||
|
||||
auto cmdWalker = (GPGPU_WALKER *)this->cmdWalker;
|
||||
EXPECT_NE(nullptr, cmdWalker);
|
||||
|
||||
auto cmdSBA = (STATE_BASE_ADDRESS *)cmdStateBaseAddress;
|
||||
EXPECT_NE(nullptr, cmdSBA);
|
||||
|
||||
auto offsetCrossThreadData = cmdWalker->getIndirectDataStartAddress();
|
||||
EXPECT_LT(offsetCrossThreadData, cmdSBA->getIndirectObjectBufferSize() * MemoryConstants::pageSize);
|
||||
|
||||
offsetCrossThreadData -= static_cast<uint32_t>(ioh.getGraphicsAllocation()->getGpuAddressToPatch());
|
||||
|
||||
// Get the base of cross thread
|
||||
auto pCrossThreadData = ptrOffset(
|
||||
reinterpret_cast<const void *>(ioh.getCpuBase()),
|
||||
offsetCrossThreadData);
|
||||
|
||||
// Determine where the argument is
|
||||
auto &patchInfo = kernel.getKernelInfo().patchInfo;
|
||||
for (auto &arg : patchInfo.statelessGlobalMemObjKernelArgs) {
|
||||
if (arg->ArgumentNumber == indexArg) {
|
||||
return ptrOffset(pCrossThreadData, arg->DataParamOffset);
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
@@ -10,13 +10,13 @@
|
||||
#include "shared/source/direct_submission/dispatchers/render_dispatcher.h"
|
||||
#include "shared/source/helpers/flush_stamp.h"
|
||||
#include "shared/source/os_interface/os_context.h"
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.h"
|
||||
#include "shared/test/unit_test/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/unit_test/helpers/ult_hw_config.h"
|
||||
#include "shared/test/unit_test/mocks/mock_direct_submission_hw.h"
|
||||
|
||||
#include "opencl/test/unit_test/fixtures/device_fixture.h"
|
||||
#include "opencl/test/unit_test/helpers/dispatch_flags_helper.h"
|
||||
#include "opencl/test/unit_test/helpers/hw_parse.h"
|
||||
#include "opencl/test/unit_test/helpers/variable_backup.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_csr.h"
|
||||
#include "test.h"
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/direct_submission/dispatchers/dispatcher.h"
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.h"
|
||||
#include "shared/test/unit_test/direct_submission/dispatchers/dispatcher_fixture.h"
|
||||
|
||||
#include "opencl/test/unit_test/helpers/hw_parse.h"
|
||||
#include "test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/direct_submission/dispatchers/render_dispatcher.h"
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.h"
|
||||
#include "shared/test/unit_test/direct_submission/dispatchers/dispatcher_fixture.h"
|
||||
#include "shared/test/unit_test/fixtures/preemption_fixture.h"
|
||||
|
||||
#include "opencl/test/unit_test/helpers/hw_parse.h"
|
||||
#include "test.h"
|
||||
|
||||
using RenderDispatcheTest = Test<DispatcherFixture>;
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
#include "shared/source/gmm_helper/gmm_helper.h"
|
||||
#include "shared/source/os_interface/windows/os_context_win.h"
|
||||
#include "shared/source/os_interface/windows/wddm/wddm.h"
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.h"
|
||||
#include "shared/test/unit_test/helpers/ult_hw_config.h"
|
||||
|
||||
#include "opencl/test/unit_test/helpers/hw_parse.h"
|
||||
#include "opencl/test/unit_test/helpers/variable_backup.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_device.h"
|
||||
#include "opencl/test/unit_test/os_interface/windows/wddm_fixture.h"
|
||||
|
||||
@@ -6,10 +6,9 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/ptr_math.h"
|
||||
#include "shared/test/unit_test/cmd_parse/gen_cmd_parse.h"
|
||||
#include "shared/test/unit_test/fixtures/command_container_fixture.h"
|
||||
|
||||
#include "opencl/test/unit_test/gen_common/gen_cmd_parse.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using CommandEncodeAtomic = Test<CommandEncodeStatesFixture>;
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
#include "shared/source/command_container/cmdcontainer.h"
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/test/unit_test/cmd_parse/gen_cmd_parse.h"
|
||||
|
||||
#include "opencl/test/unit_test/fixtures/device_fixture.h"
|
||||
#include "opencl/test/unit_test/gen_common/gen_cmd_parse.h"
|
||||
#include "test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/ptr_math.h"
|
||||
#include "shared/test/unit_test/cmd_parse/gen_cmd_parse.h"
|
||||
#include "shared/test/unit_test/fixtures/command_container_fixture.h"
|
||||
#include "shared/test/unit_test/mocks/mock_dispatch_kernel_encoder_interface.h"
|
||||
|
||||
#include "opencl/source/helpers/hardware_commands_helper.h"
|
||||
#include "opencl/test/unit_test/gen_common/gen_cmd_parse.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/source/helpers/register_offsets.h"
|
||||
#include "shared/test/unit_test/cmd_parse/gen_cmd_parse.h"
|
||||
|
||||
#include "opencl/test/unit_test/fixtures/device_fixture.h"
|
||||
#include "opencl/test/unit_test/gen_common/gen_cmd_parse.h"
|
||||
#include "test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
@@ -6,10 +6,9 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/ptr_math.h"
|
||||
#include "shared/test/unit_test/cmd_parse/gen_cmd_parse.h"
|
||||
#include "shared/test/unit_test/fixtures/command_container_fixture.h"
|
||||
|
||||
#include "opencl/test/unit_test/gen_common/gen_cmd_parse.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using CommandEncodeStatesTest = Test<CommandEncodeStatesFixture>;
|
||||
|
||||
@@ -7,10 +7,9 @@
|
||||
|
||||
#include "shared/source/command_stream/linear_stream.h"
|
||||
#include "shared/source/helpers/ptr_math.h"
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.h"
|
||||
#include "shared/test/unit_test/fixtures/command_container_fixture.h"
|
||||
|
||||
#include "opencl/test/unit_test/helpers/hw_parse.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using CommandEncodeSemaphore = Test<CommandEncodeStatesFixture>;
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/test/unit_test/cmd_parse/gen_cmd_parse.h"
|
||||
|
||||
#include "opencl/test/unit_test/fixtures/device_fixture.h"
|
||||
#include "opencl/test/unit_test/gen_common/gen_cmd_parse.h"
|
||||
#include "test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
@@ -7,10 +7,9 @@
|
||||
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/helpers/ptr_math.h"
|
||||
#include "shared/test/unit_test/cmd_parse/gen_cmd_parse.h"
|
||||
#include "shared/test/unit_test/fixtures/command_container_fixture.h"
|
||||
|
||||
#include "opencl/test/unit_test/gen_common/gen_cmd_parse.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
using CommandEncodeStatesTest = Test<CommandEncodeStatesFixture>;
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "shared/source/command_stream/preemption.h"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.h"
|
||||
|
||||
#include "opencl/source/command_queue/enqueue_common.h"
|
||||
#include "opencl/source/command_queue/enqueue_kernel.h"
|
||||
@@ -16,7 +17,6 @@
|
||||
#include "opencl/source/helpers/dispatch_info.h"
|
||||
#include "opencl/source/scheduler/scheduler_kernel.h"
|
||||
#include "opencl/test/unit_test/fixtures/hello_world_fixture.h"
|
||||
#include "opencl/test/unit_test/helpers/hw_parse.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_device.h"
|
||||
|
||||
@@ -5,17 +5,17 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/test/unit_test/gen_common/gen_cmd_parse.h"
|
||||
#include "shared/test/unit_test/cmd_parse/gen_cmd_parse.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
using GenStruct = NEO::GEN11;
|
||||
using GenGfxFamily = NEO::ICLFamily;
|
||||
#include "opencl/test/unit_test/gen_common/cmd_parse_base.inl"
|
||||
#include "opencl/test/unit_test/gen_common/cmd_parse_base_mi_arb.inl"
|
||||
#include "opencl/test/unit_test/gen_common/cmd_parse_gpgpu_walker.inl"
|
||||
#include "opencl/test/unit_test/gen_common/cmd_parse_sip.inl"
|
||||
#include "opencl/test/unit_test/helpers/hw_parse.h"
|
||||
#include "opencl/test/unit_test/helpers/hw_parse.inl"
|
||||
#include "shared/test/unit_test/cmd_parse/cmd_parse_base.inl"
|
||||
#include "shared/test/unit_test/cmd_parse/cmd_parse_base_mi_arb.inl"
|
||||
#include "shared/test/unit_test/cmd_parse/cmd_parse_gpgpu_walker.inl"
|
||||
#include "shared/test/unit_test/cmd_parse/cmd_parse_sip.inl"
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.h"
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.inl"
|
||||
|
||||
template <>
|
||||
size_t CmdParse<GenGfxFamily>::getCommandLengthHwSpecific(void *cmd) {
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
#include "shared/source/built_ins/built_ins.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.h"
|
||||
#include "shared/test/unit_test/fixtures/preemption_fixture.h"
|
||||
|
||||
#include "opencl/test/unit_test/helpers/hw_parse.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_buffer.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_csr.h"
|
||||
|
||||
@@ -5,18 +5,18 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/test/unit_test/gen_common/gen_cmd_parse.h"
|
||||
#include "shared/test/unit_test/cmd_parse/gen_cmd_parse.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
using GenStruct = NEO::GEN12LP;
|
||||
using GenGfxFamily = NEO::TGLLPFamily;
|
||||
#include "opencl/test/unit_test/gen_common/cmd_parse_base.inl"
|
||||
#include "opencl/test/unit_test/gen_common/cmd_parse_compute_mode.inl"
|
||||
#include "opencl/test/unit_test/gen_common/cmd_parse_gpgpu_walker.inl"
|
||||
#include "opencl/test/unit_test/gen_common/cmd_parse_mi_arb.inl"
|
||||
#include "opencl/test/unit_test/gen_common/cmd_parse_sip.inl"
|
||||
#include "opencl/test/unit_test/helpers/hw_parse.h"
|
||||
#include "opencl/test/unit_test/helpers/hw_parse.inl"
|
||||
#include "shared/test/unit_test/cmd_parse/cmd_parse_base.inl"
|
||||
#include "shared/test/unit_test/cmd_parse/cmd_parse_compute_mode.inl"
|
||||
#include "shared/test/unit_test/cmd_parse/cmd_parse_gpgpu_walker.inl"
|
||||
#include "shared/test/unit_test/cmd_parse/cmd_parse_mi_arb.inl"
|
||||
#include "shared/test/unit_test/cmd_parse/cmd_parse_sip.inl"
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.h"
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.inl"
|
||||
|
||||
#include "cmd_parse_gen12lp.inl"
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
#include "shared/source/command_container/cmdcontainer.h"
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/test/unit_test/cmd_parse/gen_cmd_parse.h"
|
||||
|
||||
#include "opencl/test/unit_test/fixtures/device_fixture.h"
|
||||
#include "opencl/test/unit_test/gen_common/gen_cmd_parse.h"
|
||||
#include "test.h"
|
||||
|
||||
#include "reg_configs_common.h"
|
||||
|
||||
@@ -5,17 +5,17 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/test/unit_test/gen_common/gen_cmd_parse.h"
|
||||
#include "shared/test/unit_test/cmd_parse/gen_cmd_parse.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
using GenStruct = NEO::GEN8;
|
||||
using GenGfxFamily = NEO::BDWFamily;
|
||||
#include "opencl/test/unit_test/gen_common/cmd_parse_base.inl"
|
||||
#include "opencl/test/unit_test/gen_common/cmd_parse_base_mi_arb.inl"
|
||||
#include "opencl/test/unit_test/gen_common/cmd_parse_gpgpu_walker.inl"
|
||||
#include "opencl/test/unit_test/gen_common/cmd_parse_sip.inl"
|
||||
#include "opencl/test/unit_test/helpers/hw_parse.h"
|
||||
#include "opencl/test/unit_test/helpers/hw_parse.inl"
|
||||
#include "shared/test/unit_test/cmd_parse/cmd_parse_base.inl"
|
||||
#include "shared/test/unit_test/cmd_parse/cmd_parse_base_mi_arb.inl"
|
||||
#include "shared/test/unit_test/cmd_parse/cmd_parse_gpgpu_walker.inl"
|
||||
#include "shared/test/unit_test/cmd_parse/cmd_parse_sip.inl"
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.h"
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.inl"
|
||||
|
||||
template <>
|
||||
size_t CmdParse<GenGfxFamily>::getCommandLengthHwSpecific(void *cmd) {
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
#include "shared/source/command_stream/preemption.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/memory_manager/memory_constants.h"
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.h"
|
||||
#include "shared/test/unit_test/fixtures/preemption_fixture.h"
|
||||
|
||||
#include "opencl/test/unit_test/command_queue/enqueue_fixture.h"
|
||||
#include "opencl/test/unit_test/fixtures/hello_world_fixture.h"
|
||||
#include "opencl/test/unit_test/helpers/hw_parse.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_buffer.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_csr.h"
|
||||
|
||||
@@ -5,17 +5,17 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/test/unit_test/gen_common/gen_cmd_parse.h"
|
||||
#include "shared/test/unit_test/cmd_parse/gen_cmd_parse.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
using GenStruct = NEO::GEN9;
|
||||
using GenGfxFamily = NEO::SKLFamily;
|
||||
#include "opencl/test/unit_test/gen_common/cmd_parse_base.inl"
|
||||
#include "opencl/test/unit_test/gen_common/cmd_parse_base_mi_arb.inl"
|
||||
#include "opencl/test/unit_test/gen_common/cmd_parse_gpgpu_walker.inl"
|
||||
#include "opencl/test/unit_test/gen_common/cmd_parse_sip.inl"
|
||||
#include "opencl/test/unit_test/helpers/hw_parse.h"
|
||||
#include "opencl/test/unit_test/helpers/hw_parse.inl"
|
||||
#include "shared/test/unit_test/cmd_parse/cmd_parse_base.inl"
|
||||
#include "shared/test/unit_test/cmd_parse/cmd_parse_base_mi_arb.inl"
|
||||
#include "shared/test/unit_test/cmd_parse/cmd_parse_gpgpu_walker.inl"
|
||||
#include "shared/test/unit_test/cmd_parse/cmd_parse_sip.inl"
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.h"
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.inl"
|
||||
|
||||
template <>
|
||||
size_t CmdParse<GenGfxFamily>::getCommandLengthHwSpecific(void *cmd) {
|
||||
|
||||
@@ -9,11 +9,10 @@
|
||||
#include "shared/source/command_stream/thread_arbitration_policy.h"
|
||||
#include "shared/source/gen9/reg_configs.h"
|
||||
#include "shared/source/helpers/preamble.h"
|
||||
#include "shared/test/unit_test/cmd_parse/gen_cmd_parse.h"
|
||||
#include "shared/test/unit_test/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/unit_test/preamble/preamble_fixture.h"
|
||||
|
||||
#include "opencl/test/unit_test/gen_common/gen_cmd_parse.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
typedef PreambleFixture SklSlm;
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
|
||||
#include "shared/source/command_container/cmdcontainer.h"
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/test/unit_test/cmd_parse/gen_cmd_parse.h"
|
||||
|
||||
#include "opencl/test/unit_test/fixtures/device_fixture.h"
|
||||
#include "opencl/test/unit_test/gen_common/gen_cmd_parse.h"
|
||||
#include "test.h"
|
||||
|
||||
#include "reg_configs_common.h"
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
#include "shared/source/built_ins/built_ins.h"
|
||||
#include "shared/source/command_stream/preemption.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.h"
|
||||
#include "shared/test/unit_test/fixtures/preemption_fixture.h"
|
||||
|
||||
#include "opencl/test/unit_test/command_queue/enqueue_fixture.h"
|
||||
#include "opencl/test/unit_test/helpers/hw_parse.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_buffer.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_csr.h"
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/helpers/preamble.h"
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.h"
|
||||
|
||||
#include "opencl/test/unit_test/command_stream/linear_stream_fixture.h"
|
||||
#include "opencl/test/unit_test/fixtures/device_fixture.h"
|
||||
#include "opencl/test/unit_test/fixtures/platform_fixture.h"
|
||||
#include "opencl/test/unit_test/helpers/hw_parse.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
#include "shared/source/helpers/flat_batch_buffer_helper_hw.h"
|
||||
#include "shared/source/helpers/preamble.h"
|
||||
#include "shared/source/utilities/stackvec.h"
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.h"
|
||||
#include "shared/test/unit_test/helpers/debug_manager_state_restore.h"
|
||||
|
||||
#include "opencl/test/unit_test/helpers/hw_parse.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_device.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_graphics_allocation.h"
|
||||
#include "test.h"
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
|
||||
#include "shared/source/command_stream/preemption.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.h"
|
||||
#include "shared/test/unit_test/fixtures/preemption_fixture.h"
|
||||
#include "shared/test/unit_test/helpers/debug_manager_state_restore.h"
|
||||
|
||||
#include "opencl/source/command_queue/command_queue_hw.h"
|
||||
#include "opencl/source/helpers/dispatch_info.h"
|
||||
#include "opencl/test/unit_test/helpers/dispatch_flags_helper.h"
|
||||
#include "opencl/test/unit_test/helpers/hw_parse.h"
|
||||
#include "opencl/test/unit_test/libult/ult_command_stream_receiver.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_builtins.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_device.h"
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
#include "shared/source/built_ins/built_ins.h"
|
||||
#include "shared/source/command_stream/preemption.h"
|
||||
#include "shared/source/helpers/preamble.h"
|
||||
#include "shared/test/unit_test/cmd_parse/hw_parse.h"
|
||||
|
||||
#include "opencl/test/unit_test/helpers/hw_parse.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_device.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_graphics_allocation.h"
|
||||
#include "test.h"
|
||||
|
||||
Reference in New Issue
Block a user