mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
feature: allow removal of heapful code paths
Related-To: NEO-13007 Signed-off-by: Jack Myers <jack.myers@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
0243004907
commit
0aa2c4f0cb
@@ -1,16 +1,17 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
* Copyright (C) 2021-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/cmd_parse/cmd_parse_compute_walker_no_heap.inl"
|
||||
|
||||
// clang-format off
|
||||
using namespace NEO;
|
||||
using COMPUTE_WALKER = GenStruct::COMPUTE_WALKER;
|
||||
using CFE_STATE = GenStruct::CFE_STATE;
|
||||
using _3DSTATE_BINDING_TABLE_POOL_ALLOC = GenStruct::_3DSTATE_BINDING_TABLE_POOL_ALLOC;
|
||||
using MI_SET_PREDICATE = GenStruct::MI_SET_PREDICATE;
|
||||
// clang-format on
|
||||
|
||||
template <>
|
||||
@@ -51,42 +52,6 @@ _3DSTATE_BINDING_TABLE_POOL_ALLOC *genCmdCast<_3DSTATE_BINDING_TABLE_POOL_ALLOC
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
template <>
|
||||
MI_SET_PREDICATE *genCmdCast<MI_SET_PREDICATE *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<MI_SET_PREDICATE *>(buffer);
|
||||
|
||||
return MI_SET_PREDICATE::COMMAND_TYPE_MI_COMMAND == pCmd->TheStructure.Common.CommandType &&
|
||||
MI_SET_PREDICATE::MI_COMMAND_OPCODE_MI_SET_PREDICATE == pCmd->TheStructure.Common.MiCommandOpcode
|
||||
? 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;
|
||||
}
|
||||
|
||||
template <>
|
||||
template <>
|
||||
void CmdParse<GenGfxFamily>::validateCommand<STATE_BASE_ADDRESS *>(GenCmdList::iterator itorBegin, GenCmdList::iterator itorEnd) {
|
||||
}
|
||||
|
||||
template <>
|
||||
template <>
|
||||
void CmdParse<GenGfxFamily>::validateCommand<CFE_STATE *>(GenCmdList::iterator itorBegin, GenCmdList::iterator itorEnd) {
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
// clang-format off
|
||||
using namespace NEO;
|
||||
using MI_SET_PREDICATE = GenStruct::MI_SET_PREDICATE;
|
||||
// clang-format on
|
||||
|
||||
template <>
|
||||
MI_SET_PREDICATE *genCmdCast<MI_SET_PREDICATE *>(void *buffer) {
|
||||
auto pCmd = reinterpret_cast<MI_SET_PREDICATE *>(buffer);
|
||||
|
||||
return MI_SET_PREDICATE::COMMAND_TYPE_MI_COMMAND == pCmd->TheStructure.Common.CommandType &&
|
||||
MI_SET_PREDICATE::MI_COMMAND_OPCODE_MI_SET_PREDICATE == pCmd->TheStructure.Common.MiCommandOpcode
|
||||
? 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;
|
||||
}
|
||||
|
||||
template <>
|
||||
template <>
|
||||
void CmdParse<GenGfxFamily>::validateCommand<STATE_BASE_ADDRESS *>(GenCmdList::iterator itorBegin, GenCmdList::iterator itorEnd) {
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/cmd_parse/cmd_parse_3d_state_btd.inl"
|
||||
#include "shared/test/common/cmd_parse/cmd_parse_base.inl"
|
||||
#include "shared/test/common/cmd_parse/cmd_parse_compute_mode.inl"
|
||||
#include "shared/test/common/cmd_parse/cmd_parse_compute_walker_no_heap.inl"
|
||||
#include "shared/test/common/cmd_parse/cmd_parse_sip.inl"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
using STATE_SIP = GenStruct::STATE_SIP;
|
||||
|
||||
template <>
|
||||
size_t CmdParse<GenGfxFamily>::getCommandLengthHwSpecific(void *cmd) {
|
||||
{
|
||||
auto pCmd = genCmdCast<STATE_COMPUTE_MODE *>(cmd);
|
||||
if (pCmd)
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<MI_SET_PREDICATE *>(cmd);
|
||||
if (pCmd)
|
||||
return 1;
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<_3DSTATE_BTD *>(cmd);
|
||||
if (pCmd)
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<STATE_SIP *>(cmd);
|
||||
if (pCmd)
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
{
|
||||
auto pCmd = genCmdCast<XY_BLOCK_COPY_BLT *>(cmd);
|
||||
if (pCmd)
|
||||
return pCmd->TheStructure.Common.DwordLength + 2;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <>
|
||||
const char *CmdParse<GenGfxFamily>::getCommandNameHwSpecific(void *cmd) {
|
||||
if (nullptr != genCmdCast<STATE_COMPUTE_MODE *>(cmd)) {
|
||||
return "STATE_COMPUTE_MODE";
|
||||
}
|
||||
|
||||
if (nullptr != genCmdCast<MI_SET_PREDICATE *>(cmd)) {
|
||||
return "MI_SET_PREDICATE";
|
||||
}
|
||||
|
||||
if (nullptr != genCmdCast<_3DSTATE_BTD *>(cmd)) {
|
||||
return "_3DSTATE_BTD";
|
||||
}
|
||||
|
||||
if (nullptr != genCmdCast<STATE_SIP *>(cmd)) {
|
||||
return "STATE_SIP";
|
||||
}
|
||||
if (genCmdCast<XY_BLOCK_COPY_BLT *>(cmd)) {
|
||||
return "XY_BLOCK_COPY_BLT";
|
||||
}
|
||||
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
template struct CmdParse<GenGfxFamily>;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2024 Intel Corporation
|
||||
* Copyright (C) 2018-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -18,7 +18,6 @@ void HardwareParse::findHardwareCommands(IndirectHeap *dsh) {
|
||||
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;
|
||||
@@ -80,13 +79,16 @@ void HardwareParse::findHardwareCommands(IndirectHeap *dsh) {
|
||||
}
|
||||
|
||||
// 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);
|
||||
if constexpr (!FamilyType::isHeaplessRequired()) {
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
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);
|
||||
// Extract the interfaceDescriptorData
|
||||
cmdInterfaceDescriptorData = (INTERFACE_DESCRIPTOR_DATA *)(dynamicStateHeap + iddStart);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,26 +128,31 @@ const void *HardwareParse::getStatelessArgumentPointer(const KernelInfo &kernelI
|
||||
|
||||
template <typename FamilyType>
|
||||
const typename FamilyType::RENDER_SURFACE_STATE *HardwareParse::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;
|
||||
if constexpr (!FamilyType::isHeaplessRequired()) {
|
||||
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;
|
||||
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());
|
||||
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);
|
||||
} else {
|
||||
UNRECOVERABLE_IF(true);
|
||||
return nullptr;
|
||||
}
|
||||
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);
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -208,7 +208,7 @@ uint32_t UnitTestHelper<Family>::getDebugModeRegisterOffset() {
|
||||
}
|
||||
|
||||
template <>
|
||||
bool UnitTestHelper<Family>::getDisableFusionStateFromFrontEndCommand(const typename Family::FrontEndStateCommand &feCmd) {
|
||||
bool UnitTestHelperWithHeap<Family>::getDisableFusionStateFromFrontEndCommand(const typename Family::FrontEndStateCommand &feCmd) {
|
||||
return feCmd.getDisableSlice0Subslice2();
|
||||
}
|
||||
|
||||
@@ -218,4 +218,5 @@ bool UnitTestHelper<Family>::getSystolicFlagValueFromPipelineSelectCommand(const
|
||||
}
|
||||
|
||||
template struct UnitTestHelper<Family>;
|
||||
template struct UnitTestHelperWithHeap<Family>;
|
||||
} // namespace NEO
|
||||
|
||||
@@ -37,7 +37,20 @@ struct UnitTestSetter {
|
||||
};
|
||||
|
||||
template <typename GfxFamily>
|
||||
struct UnitTestHelper {
|
||||
struct UnitTestHelperWithHeap {
|
||||
static bool getDisableFusionStateFromFrontEndCommand(const typename GfxFamily::FrontEndStateCommand &feCmd);
|
||||
static bool getComputeDispatchAllWalkerFromFrontEndCommand(const typename GfxFamily::FrontEndStateCommand &feCmd);
|
||||
};
|
||||
|
||||
template <typename GfxFamily>
|
||||
struct UnitTestHelperNoHeap {
|
||||
};
|
||||
|
||||
template <typename GfxFamily>
|
||||
using UnitTestHelperBase = std::conditional_t<GfxFamily::isHeaplessRequired(), UnitTestHelperNoHeap<GfxFamily>, UnitTestHelperWithHeap<GfxFamily>>;
|
||||
|
||||
template <typename GfxFamily>
|
||||
struct UnitTestHelper : public UnitTestHelperBase<GfxFamily> {
|
||||
using COHERENCY_TYPE = typename GfxFamily::RENDER_SURFACE_STATE::COHERENCY_TYPE;
|
||||
|
||||
static bool isL3ConfigProgrammable();
|
||||
@@ -107,8 +120,6 @@ struct UnitTestHelper {
|
||||
|
||||
static std::vector<GenCmdList::iterator> findAllMidThreadPreemptionAllocationCommand(GenCmdList::iterator begin, GenCmdList::iterator end);
|
||||
static uint32_t getInlineDataSize(bool isHeaplessEnabled);
|
||||
static bool getDisableFusionStateFromFrontEndCommand(const typename GfxFamily::FrontEndStateCommand &feCmd);
|
||||
static bool getComputeDispatchAllWalkerFromFrontEndCommand(const typename GfxFamily::FrontEndStateCommand &feCmd);
|
||||
static bool getSystolicFlagValueFromPipelineSelectCommand(const typename GfxFamily::PIPELINE_SELECT &pipelineSelectCmd);
|
||||
static size_t getAdditionalDshSize(uint32_t iddCount);
|
||||
static bool expectNullDsh(const DeviceInfo &deviceInfo);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2024 Intel Corporation
|
||||
* Copyright (C) 2018-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -62,12 +62,12 @@ void UnitTestHelper<GfxFamily>::validateSbaMocs(uint32_t expectedMocs, CommandSt
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
bool UnitTestHelper<GfxFamily>::getDisableFusionStateFromFrontEndCommand(const typename GfxFamily::FrontEndStateCommand &feCmd) {
|
||||
bool UnitTestHelperWithHeap<GfxFamily>::getDisableFusionStateFromFrontEndCommand(const typename GfxFamily::FrontEndStateCommand &feCmd) {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
bool UnitTestHelper<GfxFamily>::getComputeDispatchAllWalkerFromFrontEndCommand(const typename GfxFamily::FrontEndStateCommand &feCmd) {
|
||||
bool UnitTestHelperWithHeap<GfxFamily>::getComputeDispatchAllWalkerFromFrontEndCommand(const typename GfxFamily::FrontEndStateCommand &feCmd) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#pragma once
|
||||
|
||||
using IsGen12LP = IsGfxCore<IGFX_GEN12LP_CORE>;
|
||||
using IsAtLeastGen12LP = IsAtLeastGfxCore<IGFX_GEN12LP_CORE>;
|
||||
using IsXeHpgCore = IsGfxCore<IGFX_XE_HPG_CORE>;
|
||||
using IsXeHpcCore = IsGfxCore<IGFX_XE_HPC_CORE>;
|
||||
using IsNotXeHpcCore = IsNotGfxCore<IGFX_XE_HPC_CORE>;
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
* Copyright (C) 2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#define HEAPFUL_HWTEST_F(test_fixture, test_name) \
|
||||
HWTEST2_F(test_fixture, test_name, IsHeapfulSupported)
|
||||
|
||||
#define HEAPFUL_HWTEST_P(test_fixture, test_name) \
|
||||
HWTEST2_P(test_fixture, test_name, IsHeapfulSupported)
|
||||
38
shared/test/common/test_macros/header/heapless_matchers.h
Normal file
38
shared/test/common/test_macros/header/heapless_matchers.h
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (C) 2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "test_traits_common.h"
|
||||
|
||||
struct IsHeapfulSupported {
|
||||
template <PRODUCT_FAMILY prodFamily>
|
||||
static constexpr bool isMatched() {
|
||||
return TestTraits<NEO::template ToGfxCoreFamily<prodFamily>::get()>::heaplessRequired == false;
|
||||
}
|
||||
};
|
||||
|
||||
struct IsHeaplessRequired {
|
||||
template <PRODUCT_FAMILY prodFamily>
|
||||
static constexpr bool isMatched() {
|
||||
return TestTraits<NEO::template ToGfxCoreFamily<prodFamily>::get()>::heaplessRequired == true;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename DependentMatcher>
|
||||
struct IsHeapfulSupportedAnd {
|
||||
template <PRODUCT_FAMILY prodFamily>
|
||||
static constexpr bool isMatched() {
|
||||
return IsHeapfulSupported::template isMatched<prodFamily>() && DependentMatcher::template isMatched<prodFamily>();
|
||||
}
|
||||
};
|
||||
|
||||
using IsHeapfulSupportedAndAtLeastXeHpCore = IsHeapfulSupportedAnd<IsAtLeastXeHpCore>;
|
||||
using IsHeapfulSupportedAndAtLeastXeHpcCore = IsHeapfulSupportedAnd<IsAtLeastXeHpcCore>;
|
||||
using IsHeapfulSupportedAndAtLeastXe3Core = IsHeapfulSupportedAnd<IsAtLeastXe3Core>;
|
||||
using IsHeapfulSupportedAndAtLeastXeHpgCore = IsHeapfulSupportedAnd<IsAtLeastXeHpgCore>;
|
||||
using IsHeapfulSupportedAndDG2AndLater = IsHeapfulSupportedAndAtLeastXeHpgCore;
|
||||
using IsHeapfulSupportedAndAtLeastXe2HpgCore = IsHeapfulSupportedAnd<IsAtLeastXe2HpgCore>;
|
||||
using IsHeapfulSupportedAndAtLeastGen12LP = IsHeapfulSupportedAnd<IsAtLeastGen12LP>;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2024 Intel Corporation
|
||||
* Copyright (C) 2024-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -18,5 +18,6 @@ using Family = NEO::Xe2HpgCoreFamily;
|
||||
namespace NEO {
|
||||
|
||||
template struct UnitTestHelper<Family>;
|
||||
template struct UnitTestHelperWithHeap<Family>;
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -42,5 +42,6 @@ uint32_t UnitTestHelper<Family>::getProgrammedGrfValue(CommandStreamReceiver &cs
|
||||
}
|
||||
|
||||
template struct UnitTestHelper<Family>;
|
||||
template struct UnitTestHelperWithHeap<Family>;
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2024 Intel Corporation
|
||||
* Copyright (C) 2021-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -38,7 +38,7 @@ bool UnitTestHelper<Family>::isAdditionalMiSemaphoreWaitRequired(const RootDevic
|
||||
}
|
||||
|
||||
template <>
|
||||
bool UnitTestHelper<Family>::getComputeDispatchAllWalkerFromFrontEndCommand(const typename Family::FrontEndStateCommand &feCmd) {
|
||||
bool UnitTestHelperWithHeap<Family>::getComputeDispatchAllWalkerFromFrontEndCommand(const typename Family::FrontEndStateCommand &feCmd) {
|
||||
return feCmd.getComputeDispatchAllWalkerEnable();
|
||||
}
|
||||
|
||||
@@ -58,5 +58,6 @@ void UnitTestHelper<Family>::verifyDummyBlitWa(const RootDeviceEnvironment *root
|
||||
}
|
||||
}
|
||||
template struct UnitTestHelper<Family>;
|
||||
template struct UnitTestHelperWithHeap<Family>;
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
* Copyright (C) 2021-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -30,7 +30,7 @@ template <>
|
||||
const bool UnitTestHelper<Family>::additionalMiFlushDwRequired = true;
|
||||
|
||||
template <>
|
||||
bool UnitTestHelper<Family>::getDisableFusionStateFromFrontEndCommand(const typename Family::FrontEndStateCommand &feCmd) {
|
||||
bool UnitTestHelperWithHeap<Family>::getDisableFusionStateFromFrontEndCommand(const typename Family::FrontEndStateCommand &feCmd) {
|
||||
return feCmd.getFusedEuDispatch();
|
||||
}
|
||||
|
||||
@@ -50,4 +50,5 @@ bool UnitTestHelper<Family>::requiresTimestampPacketsInSystemMemory(HardwareInfo
|
||||
}
|
||||
|
||||
template struct UnitTestHelper<Family>;
|
||||
template struct UnitTestHelperWithHeap<Family>;
|
||||
} // namespace NEO
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "shared/source/helpers/gfx_core_helper.h"
|
||||
#include "shared/source/helpers/in_order_cmd_helpers.h"
|
||||
#include "shared/source/helpers/pipe_control_args.h"
|
||||
#include "shared/source/indirect_heap/indirect_heap.h"
|
||||
#include "shared/source/kernel/kernel_descriptor.h"
|
||||
#include "shared/source/memory_manager/graphics_allocation.h"
|
||||
#include "shared/source/memory_manager/memory_manager.h"
|
||||
@@ -36,6 +37,13 @@
|
||||
using namespace NEO;
|
||||
using CommandEncoderTests = ::testing::Test;
|
||||
|
||||
#include "shared/test/common/test_macros/header/heapless_matchers.h"
|
||||
|
||||
HWTEST2_F(CommandEncoderTests, whenPushBindingTableAndSurfaceStatesIsCalledAndHeaplessRequiredThenFail, IsHeaplessRequired) {
|
||||
std::byte mockHeap[sizeof(IndirectHeap)];
|
||||
EXPECT_ANY_THROW(EncodeSurfaceState<FamilyType>::pushBindingTableAndSurfaceStates(reinterpret_cast<IndirectHeap &>(mockHeap), nullptr, 0, 0, 0));
|
||||
}
|
||||
|
||||
HWTEST_F(CommandEncoderTests, givenMisalignedSizeWhenProgrammingSurfaceStateForBufferThenAlignedSizeIsProgrammed) {
|
||||
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
|
||||
|
||||
@@ -951,9 +959,9 @@ HWTEST2_F(CommandEncoderTests, whenAskingForImplicitScalingValuesThenAlwaysRetur
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandEncoderTests, givenInterfaceDescriptorWhenEncodeEuSchedulingPolicyIsCalledThenChanged, IsAtLeastXe3Core) {
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename EncodeDispatchKernel<FamilyType>::INTERFACE_DESCRIPTOR_DATA;
|
||||
|
||||
INTERFACE_DESCRIPTOR_DATA idd = FamilyType::cmdInitInterfaceDescriptorData;
|
||||
auto idd = FamilyType::template getInitInterfaceDescriptor<INTERFACE_DESCRIPTOR_DATA>();
|
||||
|
||||
KernelDescriptor kernelDescriptor;
|
||||
kernelDescriptor.kernelAttributes.threadArbitrationPolicy = ThreadArbitrationPolicy::AgeBased;
|
||||
|
||||
@@ -69,6 +69,8 @@ namespace NEO {
|
||||
extern ApiSpecificConfig::ApiType apiTypeForUlts;
|
||||
} // namespace NEO
|
||||
using namespace NEO;
|
||||
#include "shared/test/common/test_macros/header/heapful_test_definitions.h"
|
||||
#include "shared/test/common/test_macros/header/heapless_matchers.h"
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
struct CommandStreamReceiverTest : public DeviceFixture,
|
||||
@@ -2890,7 +2892,7 @@ HWTEST_F(CommandStreamReceiverTest,
|
||||
|
||||
using CommandStreamReceiverHwTest = Test<CommandStreamReceiverFixture>;
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverHwTest, givenSshHeapNotProvidedWhenFlushTaskPerformedThenSbaProgammedSurfaceBaseAddressToZero, IsAtLeastXeHpCore) {
|
||||
HWTEST2_F(CommandStreamReceiverHwTest, givenSshHeapNotProvidedWhenFlushTaskPerformedThenSbaProgammedSurfaceBaseAddressToZero, IsHeapfulSupportedAndAtLeastXeHpCore) {
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
using _3DSTATE_BINDING_TABLE_POOL_ALLOC = typename FamilyType::_3DSTATE_BINDING_TABLE_POOL_ALLOC;
|
||||
|
||||
@@ -3603,7 +3605,7 @@ HWTEST_F(CommandStreamReceiverHwTest, givenDcFlushForcedWhenSendRenderStateCache
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
givenRayTracingAllocationPresentWhenFlushingTaskThenDispatchBtdStateCommandOnceAndResidentAlways,
|
||||
IsAtLeastXeHpCore) {
|
||||
IsHeapfulSupportedAndAtLeastXeHpCore) {
|
||||
using _3DSTATE_BTD = typename FamilyType::_3DSTATE_BTD;
|
||||
|
||||
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
@@ -3831,7 +3833,7 @@ HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
givenImmediateFlushTaskWhenFrontEndNotInitializedThenDispatchFrontEndCommand,
|
||||
IsAtLeastXeHpCore) {
|
||||
IsHeapfulSupportedAndAtLeastXeHpCore) {
|
||||
using CFE_STATE = typename FamilyType::CFE_STATE;
|
||||
|
||||
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
@@ -4081,7 +4083,7 @@ HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
givenImmediateFlushTaskAndBindingPoolBaseAddressNeededWhenStateBaseAddressNotInitializedThenDispatchStateBaseAddressAndBindingPoolBaseAddressCommand,
|
||||
IsAtLeastXeHpCore) {
|
||||
IsHeapfulSupportedAndAtLeastXeHpCore) {
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
using _3DSTATE_BINDING_TABLE_POOL_ALLOC = typename FamilyType::_3DSTATE_BINDING_TABLE_POOL_ALLOC;
|
||||
|
||||
@@ -4141,7 +4143,7 @@ HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
givenImmediateFlushTaskAndBindingPoolBaseAddressNeededWhenStateBaseAddressInitializedAndHeapsChangedThenDispatchStateBaseAddressAndBindingPoolBaseAddressCommandTwice,
|
||||
IsAtLeastXeHpCore) {
|
||||
IsHeapfulSupportedAndAtLeastXeHpCore) {
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
using _3DSTATE_BINDING_TABLE_POOL_ALLOC = typename FamilyType::_3DSTATE_BINDING_TABLE_POOL_ALLOC;
|
||||
|
||||
@@ -4184,7 +4186,7 @@ HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
givenImmediateFlushTaskNonKernelDispatchWhenStateBaseAddressInitializedThenDispatchInitialStateBaseAddressAndIgnoreRequiredStreamProperties,
|
||||
IsAtLeastXeHpCore) {
|
||||
IsHeapfulSupportedAndAtLeastXeHpCore) {
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
using _3DSTATE_BINDING_TABLE_POOL_ALLOC = typename FamilyType::_3DSTATE_BINDING_TABLE_POOL_ALLOC;
|
||||
|
||||
@@ -4224,7 +4226,7 @@ HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
givenImmediateFlushTaskAndBindingPoolBaseAddressNeededWhenStateBaseAddressPropertiesNotProvidedForFirstFlushThenDispatchSecondSbaCommandWhenProvided,
|
||||
IsAtLeastXeHpCore) {
|
||||
IsHeapfulSupportedAndAtLeastXeHpCore) {
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
using _3DSTATE_BINDING_TABLE_POOL_ALLOC = typename FamilyType::_3DSTATE_BINDING_TABLE_POOL_ALLOC;
|
||||
|
||||
@@ -4281,7 +4283,7 @@ HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
givenImmediateFlushTaskAndGlobalStatelessHeapWhenStateBaseAddressNotInitializedThenDispatchStateBaseAddressAndNoBindingPoolBaseAddressCommand,
|
||||
IsAtLeastXeHpCore) {
|
||||
IsHeapfulSupportedAndAtLeastXeHpCore) {
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
using _3DSTATE_BINDING_TABLE_POOL_ALLOC = typename FamilyType::_3DSTATE_BINDING_TABLE_POOL_ALLOC;
|
||||
|
||||
@@ -4326,7 +4328,7 @@ HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
givenImmediateFlushTaskAndGlobalStatelessHeapWhenStateBaseAddressNotInitializedThenDispatchStateBaseAddressCommandTwice,
|
||||
IsAtLeastXeHpCore) {
|
||||
IsHeapfulSupportedAndAtLeastXeHpCore) {
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
using _3DSTATE_BINDING_TABLE_POOL_ALLOC = typename FamilyType::_3DSTATE_BINDING_TABLE_POOL_ALLOC;
|
||||
|
||||
@@ -4374,7 +4376,7 @@ HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
givenImmediateFlushTaskWhenNextDispatchRequiresScratchSpaceThenFrontEndCommandIsDispatched,
|
||||
IsAtLeastXeHpCore) {
|
||||
IsHeapfulSupportedAndAtLeastXeHpCore) {
|
||||
using CFE_STATE = typename FamilyType::CFE_STATE;
|
||||
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
|
||||
|
||||
@@ -4429,7 +4431,7 @@ HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
givenImmediateFlushTaskWhenNextDispatchRequiresPrivateScratchSpaceThenFrontEndCommandIsDispatched,
|
||||
IsAtLeastXeHpCore) {
|
||||
IsHeapfulSupportedAndAtLeastXeHpCore) {
|
||||
using CFE_STATE = typename FamilyType::CFE_STATE;
|
||||
using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE;
|
||||
|
||||
@@ -4468,7 +4470,7 @@ HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
givenImmediateFlushTaskWhenOneTimeContextSystemFenceRequiredThenExpectOneTimeSystemFenceCommand,
|
||||
IsAtLeastXeHpcCore) {
|
||||
IsHeapfulSupportedAndAtLeastXeHpcCore) {
|
||||
using STATE_SYSTEM_MEM_FENCE_ADDRESS = typename FamilyType::STATE_SYSTEM_MEM_FENCE_ADDRESS;
|
||||
|
||||
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
@@ -4538,7 +4540,7 @@ HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
givenImmediateFlushTaskWhenRayTracingAllocationCreatedThenOneTimeRayTracingCommandDispatched,
|
||||
IsAtLeastXeHpgCore) {
|
||||
IsHeapfulSupportedAndAtLeastXeHpgCore) {
|
||||
using _3DSTATE_BTD = typename FamilyType::_3DSTATE_BTD;
|
||||
|
||||
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
@@ -4581,7 +4583,7 @@ HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
givenImmediateFlushTaskWhenCsrHasPreambleCommandsThenDispatchIndirectJumpToImmediateBatchBuffer,
|
||||
IsAtLeastXeHpCore) {
|
||||
IsHeapfulSupportedAndAtLeastXeHpCore) {
|
||||
using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START;
|
||||
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
|
||||
|
||||
@@ -4708,7 +4710,7 @@ HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
givenImmediateFlushTaskWhenRequireTaskCountUpdateSelectedThenDispatchPipeControlPostSyncToImmediateBatchBuffer,
|
||||
IsAtLeastXeHpCore) {
|
||||
IsHeapfulSupportedAndAtLeastXeHpCore) {
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
using MI_BATCH_BUFFER_END = typename FamilyType::MI_BATCH_BUFFER_END;
|
||||
|
||||
@@ -5259,7 +5261,7 @@ HWTEST_F(CommandStreamReceiverHwTest, givenDcFlushRequiredFalseWhenProgramStalli
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
givenImmediateFlushTaskWhenNextDispatchRequiresScratchSpaceAndSshPointerIsNullThenFrontEndCommandIsNotDispatched,
|
||||
IsAtLeastXeHpCore) {
|
||||
IsHeapfulSupportedAndAtLeastXeHpCore) {
|
||||
using CFE_STATE = typename FamilyType::CFE_STATE;
|
||||
|
||||
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
@@ -5294,7 +5296,7 @@ HWTEST_F(CommandStreamReceiverTest, givenCsrWhenCleanUpResourcesThenOwnedPrivate
|
||||
EXPECT_EQ(mapForReuse->size(), 0u);
|
||||
}
|
||||
|
||||
HWTEST_F(CommandStreamReceiverHwTest, GivenDirtyFlagForContextInBindlessHelperWhenFlushTaskCalledThenStateCacheInvalidateIsSent) {
|
||||
HWTEST2_F(CommandStreamReceiverHwTest, GivenDirtyFlagForContextInBindlessHelperWhenFlushTaskCalledThenStateCacheInvalidateIsSent, IsHeapfulSupported) {
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
|
||||
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
@@ -5344,7 +5346,7 @@ HWTEST_F(CommandStreamReceiverHwTest, GivenDirtyFlagForContextInBindlessHelperWh
|
||||
EXPECT_FALSE(bindlessHeapsHelperPtr->getStateDirtyForContext(commandStreamReceiver.getOsContext().getContextId()));
|
||||
}
|
||||
|
||||
HWTEST_F(CommandStreamReceiverHwTest, GivenDirtyFlagForContextInBindlessHelperWhenFlushImmediateTaskCalledThenStateCacheInvalidateIsSent) {
|
||||
HEAPFUL_HWTEST_F(CommandStreamReceiverHwTest, GivenDirtyFlagForContextInBindlessHelperWhenFlushImmediateTaskCalledThenStateCacheInvalidateIsSent) {
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
|
||||
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
@@ -5370,7 +5372,7 @@ HWTEST_F(CommandStreamReceiverHwTest, GivenDirtyFlagForContextInBindlessHelperWh
|
||||
EXPECT_FALSE(bindlessHeapsHelperPtr->getStateDirtyForContext(commandStreamReceiver.getOsContext().getContextId()));
|
||||
}
|
||||
|
||||
HWTEST_F(CommandStreamReceiverHwTest, GivenContextInitializedAndDirtyFlagForContextInBindlessHelperWhenFlushImmediateTaskCalledThenStateCacheInvalidateIsSentBeforeBbStartJumpingToImmediateBuffer) {
|
||||
HWTEST2_F(CommandStreamReceiverHwTest, GivenContextInitializedAndDirtyFlagForContextInBindlessHelperWhenFlushImmediateTaskCalledThenStateCacheInvalidateIsSentBeforeBbStartJumpingToImmediateBuffer, IsHeapfulSupported) {
|
||||
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||
using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START;
|
||||
|
||||
@@ -6004,7 +6006,7 @@ HWTEST_F(CommandStreamReceiverHwHeaplessTest, whenHeaplessCommandStreamReceiverF
|
||||
|
||||
HWTEST2_F(CommandStreamReceiverHwTest,
|
||||
givenImmediateFlushTaskInHeaplessModeWhenNextDispatchRequiresScratchSpaceThenNoScratchIsAllocated,
|
||||
IsAtLeastXeHpCore) {
|
||||
IsHeapfulSupportedAndAtLeastXeHpCore) {
|
||||
using CFE_STATE = typename FamilyType::CFE_STATE;
|
||||
|
||||
auto &commandStreamReceiver = pDevice->getUltCommandStreamReceiver<FamilyType>();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2024 Intel Corporation
|
||||
* Copyright (C) 2021-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -18,7 +18,7 @@ using namespace NEO;
|
||||
using DG2CommandEncoderTest = Test<DeviceFixture>;
|
||||
HWTEST_EXCLUDE_PRODUCT(XeHPAndLaterCommandEncoderTest, whenGettingRequiredSizeForStateBaseAddressCommandThenCorrectSizeIsReturned_IsAtLeastXeHpCore, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(CommandEncoderTest, whenGettingRequiredSizeForStateBaseAddressCommandThenCorrectSizeIsReturned_Platforms, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(XeHPAndLaterCommandEncoderTest, givenCommandContainerWithDirtyHeapWhenGettingRequiredSizeForStateBaseAddressCommandThenCorrectSizeIsReturned_IsAtLeastXeHpCore, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(XeHPAndLaterCommandEncoderTest, givenCommandContainerWithDirtyHeapWhenGettingRequiredSizeForStateBaseAddressCommandThenCorrectSizeIsReturned_IsHeapfulSupportedAndAtLeastXeHpCore, IGFX_DG2);
|
||||
|
||||
HWTEST2_F(DG2CommandEncoderTest, givenDG2WhenGettingRequiredSizeForStateBaseAddressCommandThenCorrectSizeIsReturned, IsDG2) {
|
||||
class MockCommandContainer : public CommandContainer {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2024 Intel Corporation
|
||||
* Copyright (C) 2021-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "test_traits_common.h"
|
||||
|
||||
using namespace NEO;
|
||||
#include "shared/test/common/test_macros/header/heapless_matchers.h"
|
||||
|
||||
using XeHPAndLaterHardwareCommandsTest = testing::Test;
|
||||
|
||||
@@ -46,11 +47,15 @@ using XeHPAndLaterCommandEncoderTest = Test<DeviceFixture>;
|
||||
|
||||
HWTEST2_F(XeHPAndLaterCommandEncoderTest, whenGettingRequiredSizeForStateBaseAddressCommandThenCorrectSizeIsReturned, IsAtLeastXeHpCore) {
|
||||
auto container = CommandContainer();
|
||||
if constexpr (FamilyType::isHeaplessRequired()) {
|
||||
EXPECT_ANY_THROW(EncodeStateBaseAddress<FamilyType>::getRequiredSizeForStateBaseAddress(*pDevice, container, false));
|
||||
return;
|
||||
}
|
||||
size_t size = EncodeStateBaseAddress<FamilyType>::getRequiredSizeForStateBaseAddress(*pDevice, container, false);
|
||||
EXPECT_EQ(size, 104ul);
|
||||
}
|
||||
|
||||
HWTEST2_F(XeHPAndLaterCommandEncoderTest, givenCommandContainerWithDirtyHeapWhenGettingRequiredSizeForStateBaseAddressCommandThenCorrectSizeIsReturned, IsAtLeastXeHpCore) {
|
||||
HWTEST2_F(XeHPAndLaterCommandEncoderTest, givenCommandContainerWithDirtyHeapWhenGettingRequiredSizeForStateBaseAddressCommandThenCorrectSizeIsReturned, IsHeapfulSupportedAndAtLeastXeHpCore) {
|
||||
auto container = CommandContainer();
|
||||
container.setHeapDirty(HeapType::surfaceState);
|
||||
size_t size = EncodeStateBaseAddress<FamilyType>::getRequiredSizeForStateBaseAddress(*pDevice, container, false);
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "shared/test/unit_test/mocks/mock_dispatch_kernel_encoder_interface.h"
|
||||
|
||||
using namespace NEO;
|
||||
#include "shared/test/common/test_macros/header/heapless_matchers.h"
|
||||
|
||||
using CommandEncodeStatesTest = Test<CommandEncodeStatesFixture>;
|
||||
|
||||
@@ -248,7 +249,7 @@ HWTEST_F(CommandEncodeStatesTest, givenCommandContainerWithUsedAvailableSizeWhen
|
||||
|
||||
HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, givenSlmTotalSizeGraterThanZeroWhenDispatchingKernelThenSharedMemorySizeSetCorrectly) {
|
||||
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename EncodeStates<FamilyType>::INTERFACE_DESCRIPTOR_DATA;
|
||||
uint32_t dims[] = {2, 1, 1};
|
||||
std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder());
|
||||
uint32_t slmTotalSize = 1;
|
||||
@@ -270,7 +271,7 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, givenSlmTotalSizeGraterT
|
||||
|
||||
HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, whenDispatchingKernelThenSetDenormMode) {
|
||||
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename EncodeStates<FamilyType>::INTERFACE_DESCRIPTOR_DATA;
|
||||
uint32_t dims[] = {2, 1, 1};
|
||||
std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder());
|
||||
|
||||
@@ -285,7 +286,7 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, whenDispatchingKernelThe
|
||||
|
||||
HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, givenDebuggingEnabledAndAssertInKernelWhenDispatchingKernelThenSwExceptionsAreEnabled) {
|
||||
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename EncodeStates<FamilyType>::INTERFACE_DESCRIPTOR_DATA;
|
||||
uint32_t dims[] = {2, 1, 1};
|
||||
std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder());
|
||||
|
||||
@@ -303,7 +304,7 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, givenDebuggingEnabledAnd
|
||||
|
||||
HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, givenSlmTotalSizeEqualZeroWhenDispatchingKernelThenSharedMemorySizeSetCorrectly) {
|
||||
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename EncodeStates<FamilyType>::INTERFACE_DESCRIPTOR_DATA;
|
||||
uint32_t dims[] = {2, 1, 1};
|
||||
std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder());
|
||||
uint32_t slmTotalSize = 0;
|
||||
@@ -325,7 +326,7 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, givenSlmTotalSizeEqualZe
|
||||
HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, givenOneBindingTableEntryWhenDispatchingKernelThenBindingTableOffsetIsCorrect) {
|
||||
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
|
||||
using BINDING_TABLE_STATE = typename FamilyType::BINDING_TABLE_STATE;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename EncodeStates<FamilyType>::INTERFACE_DESCRIPTOR_DATA;
|
||||
uint32_t numBindingTable = 1;
|
||||
BINDING_TABLE_STATE bindingTableState = FamilyType::cmdInitBindingTableState;
|
||||
|
||||
@@ -358,7 +359,7 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, givenOneBindingTableEntr
|
||||
HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, giveNumBindingTableZeroWhenDispatchingKernelThenBindingTableOffsetIsZero) {
|
||||
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
|
||||
using BINDING_TABLE_STATE = typename FamilyType::BINDING_TABLE_STATE;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename EncodeStates<FamilyType>::INTERFACE_DESCRIPTOR_DATA;
|
||||
uint32_t numBindingTable = 0;
|
||||
BINDING_TABLE_STATE bindingTableState = FamilyType::cmdInitBindingTableState;
|
||||
|
||||
@@ -389,7 +390,7 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, giveNumBindingTableZeroW
|
||||
HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, giveNumSamplersOneWhenDispatchingKernelThensamplerStateWasCopied) {
|
||||
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
|
||||
using SAMPLER_STATE = typename FamilyType::SAMPLER_STATE;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename EncodeStates<FamilyType>::INTERFACE_DESCRIPTOR_DATA;
|
||||
uint32_t numSamplers = 1;
|
||||
SAMPLER_STATE samplerState;
|
||||
memset(&samplerState, 2, sizeof(SAMPLER_STATE));
|
||||
@@ -427,7 +428,7 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, giveNumSamplersOneWhenDi
|
||||
HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, giveNumSamplersZeroWhenDispatchingKernelThensamplerStateWasNotCopied) {
|
||||
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
|
||||
using SAMPLER_STATE = typename FamilyType::SAMPLER_STATE;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename EncodeStates<FamilyType>::INTERFACE_DESCRIPTOR_DATA;
|
||||
uint32_t numSamplers = 0;
|
||||
SAMPLER_STATE samplerState;
|
||||
memset(&samplerState, 2, sizeof(SAMPLER_STATE));
|
||||
@@ -515,7 +516,7 @@ HWTEST_F(CommandEncodeStatesTest, givenIndirectOffsetsSizeWhenDispatchingKernelT
|
||||
|
||||
HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, givenForceBtpPrefetchModeDebugFlagWhenDispatchingKernelThenValuesAreSetUpCorrectly) {
|
||||
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename EncodeStates<FamilyType>::INTERFACE_DESCRIPTOR_DATA;
|
||||
using MEDIA_INTERFACE_DESCRIPTOR_LOAD = typename FamilyType::MEDIA_INTERFACE_DESCRIPTOR_LOAD;
|
||||
using SAMPLER_STATE = typename FamilyType::SAMPLER_STATE;
|
||||
using BINDING_TABLE_STATE = typename FamilyType::BINDING_TABLE_STATE;
|
||||
@@ -766,7 +767,7 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, givenCleanHeapsAndSlmCha
|
||||
|
||||
HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, giveNextIddInBlockZeroWhenDispatchKernelThenMediaInterfaceDescriptorEncoded) {
|
||||
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename EncodeStates<FamilyType>::INTERFACE_DESCRIPTOR_DATA;
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
using MEDIA_INTERFACE_DESCRIPTOR_LOAD = typename FamilyType::MEDIA_INTERFACE_DESCRIPTOR_LOAD;
|
||||
uint32_t dims[] = {2, 1, 1};
|
||||
@@ -792,7 +793,7 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, giveNextIddInBlockZeroWh
|
||||
|
||||
HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, giveNextIddInBlockZeroWhenDispatchKernelAndDynamicStateHeapDirtyThenStateBaseAddressEncodedAndMediaInterfaceDescriptorEncoded) {
|
||||
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename EncodeStates<FamilyType>::INTERFACE_DESCRIPTOR_DATA;
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
using MEDIA_INTERFACE_DESCRIPTOR_LOAD = typename FamilyType::MEDIA_INTERFACE_DESCRIPTOR_LOAD;
|
||||
uint32_t dims[] = {2, 1, 1};
|
||||
@@ -823,7 +824,7 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, giveNextIddInBlockZeroWh
|
||||
HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, giveNumSamplersOneWhenHeapIsDirtyThenSamplerStateWasCopiedAndStateBaseAddressEncoded) {
|
||||
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
|
||||
using SAMPLER_STATE = typename FamilyType::SAMPLER_STATE;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename EncodeStates<FamilyType>::INTERFACE_DESCRIPTOR_DATA;
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
using MEDIA_INTERFACE_DESCRIPTOR_LOAD = typename FamilyType::MEDIA_INTERFACE_DESCRIPTOR_LOAD;
|
||||
uint32_t numSamplers = 1;
|
||||
@@ -873,7 +874,7 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, giveNumSamplersOneWhenHe
|
||||
HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, giveNumSamplersOneAndNextIDDInBlockWhenHeapIsDirtyThenSamplerStateWasCopiedAndStateBaseAddressEncoded) {
|
||||
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
|
||||
using SAMPLER_STATE = typename FamilyType::SAMPLER_STATE;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename EncodeStates<FamilyType>::INTERFACE_DESCRIPTOR_DATA;
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
using MEDIA_INTERFACE_DESCRIPTOR_LOAD = typename FamilyType::MEDIA_INTERFACE_DESCRIPTOR_LOAD;
|
||||
uint32_t numSamplers = 1;
|
||||
@@ -1061,7 +1062,7 @@ HWTEST2_F(EncodeDispatchKernelTest, givenBindlessKernelWithRequiringSshForMisali
|
||||
}
|
||||
|
||||
HWTEST2_F(EncodeDispatchKernelTest, givenKernelsSharingISAParentAllocationsWhenProgrammingWalkerThenKernelStartPointerHasProperOffset, IsBeforeXeHpCore) {
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename EncodeStates<FamilyType>::INTERFACE_DESCRIPTOR_DATA;
|
||||
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
|
||||
|
||||
auto dispatchInterface = std::make_unique<MockDispatchKernelEncoder>();
|
||||
@@ -1076,13 +1077,13 @@ HWTEST2_F(EncodeDispatchKernelTest, givenKernelsSharingISAParentAllocationsWhenP
|
||||
}
|
||||
|
||||
HWTEST_F(EncodeDispatchKernelTest, givenKernelStartPointerAlignmentInInterfaceDescriptorWhenHelperGetterUsedThenCorrectValueReturned) {
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename EncodeStates<FamilyType>::INTERFACE_DESCRIPTOR_DATA;
|
||||
EXPECT_EQ(INTERFACE_DESCRIPTOR_DATA::KERNELSTARTPOINTER_ALIGN_SIZE, pDevice->getGfxCoreHelper().getKernelIsaPointerAlignment());
|
||||
}
|
||||
|
||||
HWTEST2_F(EncodeDispatchKernelTest, givenKernelsSharingISAParentAllocationsWhenProgrammingWalkerThenKernelStartPointerHasProperOffset, IsAtLeastXeHpCore) {
|
||||
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename EncodeStates<FamilyType>::INTERFACE_DESCRIPTOR_DATA;
|
||||
|
||||
auto dispatchInterface = std::make_unique<MockDispatchKernelEncoder>();
|
||||
dispatchInterface->getIsaOffsetInParentAllocationResult = 8 << INTERFACE_DESCRIPTOR_DATA::KERNELSTARTPOINTER_BIT_SHIFT;
|
||||
@@ -1125,7 +1126,7 @@ HWTEST2_F(EncodeDispatchKernelTest, givenPrintKernelDispatchParametersWhenEncodi
|
||||
EXPECT_NE(std::string::npos, outputString.find("threadGroupDispatchSize enum"));
|
||||
}
|
||||
|
||||
HWTEST_F(EncodeDispatchKernelTest, givenNonBindlessOrStatelessArgWhenDispatchingKernelThenSurfaceStateOffsetInCrossThreadDataIsNotPatched) {
|
||||
HWTEST2_F(EncodeDispatchKernelTest, givenNonBindlessOrStatelessArgWhenDispatchingKernelThenSurfaceStateOffsetInCrossThreadDataIsNotPatched, IsHeapfulSupported) {
|
||||
using BINDING_TABLE_STATE = typename FamilyType::BINDING_TABLE_STATE;
|
||||
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
|
||||
uint32_t numBindingTable = 1;
|
||||
@@ -1394,7 +1395,7 @@ using namespace NEO;
|
||||
using InterfaceDescriptorDataTests = ::testing::Test;
|
||||
|
||||
HWCMDTEST_F(IGFX_GEN12LP_CORE, InterfaceDescriptorDataTests, givenVariousValuesWhenCallingSetBarrierEnableThenCorrectValueIsSet) {
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename EncodeStates<FamilyType>::INTERFACE_DESCRIPTOR_DATA;
|
||||
INTERFACE_DESCRIPTOR_DATA idd = FamilyType::cmdInitInterfaceDescriptorData;
|
||||
MockDevice device;
|
||||
auto hwInfo = device.getHardwareInfo();
|
||||
@@ -1446,7 +1447,7 @@ HWTEST_F(BindlessCommandEncodeStatesContainerTest, givenBindlessKernelAndBindles
|
||||
EXPECT_EQ(commandContainer->getIndirectHeap(HeapType::surfaceState), nullptr);
|
||||
}
|
||||
|
||||
HWTEST_F(BindlessCommandEncodeStatesContainerTest, givenBindfulKernelWhenBindlessModeEnabledThenCmdContainerHasSsh) {
|
||||
HWTEST2_F(BindlessCommandEncodeStatesContainerTest, givenBindfulKernelWhenBindlessModeEnabledThenCmdContainerHasSsh, IsHeapfulSupported) {
|
||||
using BINDING_TABLE_STATE = typename FamilyType::BINDING_TABLE_STATE;
|
||||
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
|
||||
DebugManagerStateRestore dbgRestorer;
|
||||
@@ -1525,7 +1526,7 @@ HWTEST2_F(NgenGeneratorDispatchKernelEncodeTest, givenBindfulKernelAndIsNotGener
|
||||
}
|
||||
|
||||
HWTEST_F(CommandEncodeStatesTest, givenKernelInfoWhenGettingRequiredDshSpaceThenReturnCorrectValues) {
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename EncodeStates<FamilyType>::INTERFACE_DESCRIPTOR_DATA;
|
||||
using SAMPLER_STATE = typename FamilyType::SAMPLER_STATE;
|
||||
|
||||
size_t additionalSize = UnitTestHelper<FamilyType>::getAdditionalDshSize(cmdContainer->getNumIddPerBlock());
|
||||
@@ -1542,7 +1543,7 @@ HWTEST_F(CommandEncodeStatesTest, givenKernelInfoWhenGettingRequiredDshSpaceThen
|
||||
kernelInfo.kernelDescriptor.payloadMappings.samplerTable.borderColor = 0;
|
||||
|
||||
// align samplers
|
||||
size_t alignedSamplers = alignUp(2 * sizeof(SAMPLER_STATE), INTERFACE_DESCRIPTOR_DATA::SAMPLERSTATEPOINTER_ALIGN_SIZE);
|
||||
size_t alignedSamplers = alignUp(2 * sizeof(SAMPLER_STATE), InterfaceDescriptorTraits<INTERFACE_DESCRIPTOR_DATA>::samplerStatePointerAlignSize);
|
||||
|
||||
// additional IDD for requiring platforms
|
||||
if (additionalSize > 0) {
|
||||
@@ -1559,7 +1560,7 @@ HWTEST_F(CommandEncodeStatesTest, givenKernelInfoWhenGettingRequiredDshSpaceThen
|
||||
kernelInfo.kernelDescriptor.payloadMappings.samplerTable.tableOffset = 32;
|
||||
|
||||
// align border color state and samplers
|
||||
alignedSamplers = alignUp(alignUp(32, FamilyType::cacheLineSize) + 3 * sizeof(SAMPLER_STATE), INTERFACE_DESCRIPTOR_DATA::SAMPLERSTATEPOINTER_ALIGN_SIZE);
|
||||
alignedSamplers = alignUp(alignUp(32, FamilyType::cacheLineSize) + 3 * sizeof(SAMPLER_STATE), InterfaceDescriptorTraits<INTERFACE_DESCRIPTOR_DATA>::samplerStatePointerAlignSize);
|
||||
|
||||
// additional IDD for requiring platforms
|
||||
if (additionalSize > 0) {
|
||||
|
||||
@@ -21,10 +21,11 @@
|
||||
#include "shared/test/unit_test/mocks/mock_dispatch_kernel_encoder_interface.h"
|
||||
|
||||
using namespace NEO;
|
||||
#include "shared/test/common/test_macros/header/heapless_matchers.h"
|
||||
|
||||
using CommandEncodeStatesTestPvcAndLater = Test<CommandEncodeStatesFixture>;
|
||||
|
||||
HWTEST2_F(CommandEncodeStatesTestPvcAndLater, givenOverrideSlmTotalSizeDebugVariableWhenDispatchingKernelThenSharedMemorySizeIsSetCorrectly, IsAtLeastXeHpcCore) {
|
||||
HWTEST2_F(CommandEncodeStatesTestPvcAndLater, givenOverrideSlmTotalSizeDebugVariableWhenDispatchingKernelThenSharedMemorySizeIsSetCorrectly, IsHeapfulSupportedAndAtLeastXeHpcCore) {
|
||||
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
|
||||
DebugManagerStateRestore restorer;
|
||||
uint32_t dims[] = {2, 1, 1};
|
||||
|
||||
@@ -35,11 +35,12 @@
|
||||
#include <memory>
|
||||
|
||||
using namespace NEO;
|
||||
#include "shared/test/common/test_macros/header/heapless_matchers.h"
|
||||
|
||||
using CommandEncodeStatesTest = Test<CommandEncodeStatesFixture>;
|
||||
|
||||
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, givenSlmTotalSizeGraterThanZeroWhenDispatchingKernelThenSharedMemorySizeIsSetCorrectly) {
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::DefaultWalkerType::InterfaceDescriptorType;
|
||||
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
|
||||
uint32_t dims[] = {2, 1, 1};
|
||||
std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder());
|
||||
@@ -141,7 +142,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, givenSimdSizeWhenDispatchi
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, givenSlmTotalSizeEqualZeroWhenDispatchingKernelThenSharedMemorySizeIsSetCorrectly) {
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::DefaultWalkerType::InterfaceDescriptorType;
|
||||
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
|
||||
uint32_t dims[] = {2, 1, 1};
|
||||
std::unique_ptr<MockDispatchKernelEncoder> dispatchInterface(new MockDispatchKernelEncoder());
|
||||
@@ -1577,7 +1578,7 @@ HWTEST2_F(EncodeKernelScratchProgrammingTest, givenHeaplessModeDisabledWhenSetSc
|
||||
EXPECT_EQ(expectedScratchAddress, scratchAddress);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandEncodeStatesTest, givenEncodeDispatchKernelWhenGettingInlineDataOffsetThenReturnWalkerInlineOffset, IsAtLeastXeHpCore) {
|
||||
HWTEST2_F(CommandEncodeStatesTest, givenEncodeDispatchKernelWhenGettingInlineDataOffsetThenReturnWalkerInlineOffset, IsHeapfulSupportedAndAtLeastXeHpCore) {
|
||||
using DefaultWalkerType = typename FamilyType::DefaultWalkerType;
|
||||
|
||||
EncodeDispatchKernelArgs dispatchArgs = {};
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "test_traits_common.h"
|
||||
|
||||
using namespace NEO;
|
||||
#include "shared/test/common/test_macros/header/heapless_matchers.h"
|
||||
|
||||
using CommandEncodeStatesTest = Test<CommandEncodeStatesFixture>;
|
||||
|
||||
@@ -142,7 +143,7 @@ HWTEST_F(BindlessCommandEncodeStatesTest, GivenBindlessEnabledWhenBorderColorWit
|
||||
alignedFree(memory);
|
||||
}
|
||||
|
||||
HWTEST_F(BindlessCommandEncodeStatesTest, GivenBindlessHeapHelperAndGlobalDshNotUsedWhenCopyingSamplerStateThenDynamicPatternIsUsedAndOffsetFromDshProgrammed) {
|
||||
HWTEST2_F(BindlessCommandEncodeStatesTest, GivenBindlessHeapHelperAndGlobalDshNotUsedWhenCopyingSamplerStateThenDynamicPatternIsUsedAndOffsetFromDshProgrammed, IsHeapfulSupported) {
|
||||
using SAMPLER_BORDER_COLOR_STATE = typename FamilyType::SAMPLER_BORDER_COLOR_STATE;
|
||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||
|
||||
@@ -176,7 +177,7 @@ HWTEST_F(BindlessCommandEncodeStatesTest, GivenBindlessHeapHelperAndGlobalDshNot
|
||||
auto expectedValue = usedBefore + ptrDiff(dsh->getGpuBase(), globalBase);
|
||||
auto usedAfter = dsh->getUsed();
|
||||
|
||||
EXPECT_EQ(alignUp(usedBefore + sizeof(SAMPLER_BORDER_COLOR_STATE), INTERFACE_DESCRIPTOR_DATA::SAMPLERSTATEPOINTER_ALIGN_SIZE) + sizeof(SAMPLER_STATE), usedAfter);
|
||||
EXPECT_EQ(alignUp(usedBefore + sizeof(SAMPLER_BORDER_COLOR_STATE), InterfaceDescriptorTraits<INTERFACE_DESCRIPTOR_DATA>::samplerStatePointerAlignSize) + sizeof(SAMPLER_STATE), usedAfter);
|
||||
|
||||
auto pSmplr = reinterpret_cast<SAMPLER_STATE *>(ptrDiff(dsh->getSpace(0), sizeof(SAMPLER_STATE)));
|
||||
|
||||
@@ -364,7 +365,7 @@ HWTEST2_F(CommandEncodeStatesTest, givenCreatedSurfaceStateBufferWhenGpuCoherenc
|
||||
alignedFree(stateBuffer);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandEncodeStatesTest, givenCommandContainerWithDirtyHeapsWhenSetStateBaseAddressCalledThenStateBaseAddressAreNotSet, MatchAny) {
|
||||
HWTEST2_F(CommandEncodeStatesTest, givenCommandContainerWithDirtyHeapsWhenSetStateBaseAddressCalledThenStateBaseAddressAreNotSet, IsHeapfulSupported) {
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
cmdContainer->dirtyHeaps = 0;
|
||||
|
||||
@@ -460,7 +461,7 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, whenAdjustPipelineSelect
|
||||
EXPECT_EQ(initialUsed, cmdContainer->getCommandStream()->getUsed());
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandEncodeStatesTest, givenHeapSharingEnabledWhenRetrievingNotInitializedSshThenExpectCorrectSbaCommand, IsAtLeastXeHpCore) {
|
||||
HWTEST2_F(CommandEncodeStatesTest, givenHeapSharingEnabledWhenRetrievingNotInitializedSshThenExpectCorrectSbaCommand, IsHeapfulSupportedAndAtLeastXeHpCore) {
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
using _3DSTATE_BINDING_TABLE_POOL_ALLOC = typename FamilyType::_3DSTATE_BINDING_TABLE_POOL_ALLOC;
|
||||
|
||||
@@ -491,7 +492,7 @@ HWTEST2_F(CommandEncodeStatesTest, givenHeapSharingEnabledWhenRetrievingNotIniti
|
||||
EXPECT_EQ(commands.end(), itorCmd);
|
||||
}
|
||||
|
||||
HWTEST2_F(CommandEncodeStatesTest, givenSbaPropertiesWhenBindingBaseAddressSetThenExpectPropertiesDataDispatched, IsAtLeastXeHpCore) {
|
||||
HWTEST2_F(CommandEncodeStatesTest, givenSbaPropertiesWhenBindingBaseAddressSetThenExpectPropertiesDataDispatched, IsHeapfulSupportedAndAtLeastXeHpCore) {
|
||||
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
|
||||
using _3DSTATE_BINDING_TABLE_POOL_ALLOC = typename FamilyType::_3DSTATE_BINDING_TABLE_POOL_ALLOC;
|
||||
|
||||
|
||||
@@ -51,7 +51,11 @@ HWTEST2_F(CompilerProductHelperFixture, GivenXeHpcAndLaterWhenIsForceToStateless
|
||||
EXPECT_TRUE(compilerProductHelper.isForceToStatelessRequired());
|
||||
|
||||
debugManager.flags.DisableForceToStateless.set(true);
|
||||
EXPECT_FALSE(compilerProductHelper.isForceToStatelessRequired());
|
||||
if constexpr (FamilyType::isHeaplessRequired()) {
|
||||
EXPECT_TRUE(compilerProductHelper.isForceToStatelessRequired());
|
||||
} else {
|
||||
EXPECT_FALSE(compilerProductHelper.isForceToStatelessRequired());
|
||||
}
|
||||
}
|
||||
|
||||
HWTEST2_F(CompilerProductHelperFixture, GivenGen11AndLaterThenSubgroupLocalBlockIoIsSupported, MatchAny) {
|
||||
@@ -513,4 +517,4 @@ HWTEST_F(CompilerProductHelperFixture, GivenRequestForExtraKernelCapabilitiesThe
|
||||
} else {
|
||||
EXPECT_EQ(0u, extraCaps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,6 +31,9 @@
|
||||
|
||||
#include <numeric>
|
||||
|
||||
using namespace NEO;
|
||||
#include "shared/test/common/test_macros/header/heapless_matchers.h"
|
||||
|
||||
TEST(GfxCoreHelperTestCreate, WhenGfxCoreHelperIsCalledWithUnknownGfxCoreThenNullptrIsReturned) {
|
||||
EXPECT_EQ(nullptr, GfxCoreHelper::create(IGFX_UNKNOWN_CORE));
|
||||
}
|
||||
@@ -1209,7 +1212,7 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, GfxCoreHelperTest, GivenVariousValuesWhenComputeS
|
||||
EXPECT_EQ(7u, gfxCoreHelper.computeSlmValues(hwInfo, 65536, nullptr, false));
|
||||
}
|
||||
|
||||
HWTEST_F(GfxCoreHelperTest, GivenZeroSlmSizeWhenComputeSlmSizeIsCalledThenCorrectValueIsReturned) {
|
||||
HWTEST2_F(GfxCoreHelperTest, GivenZeroSlmSizeWhenComputeSlmSizeIsCalledThenCorrectValueIsReturned, IsHeapfulSupported) {
|
||||
using SHARED_LOCAL_MEMORY_SIZE = typename FamilyType::INTERFACE_DESCRIPTOR_DATA::SHARED_LOCAL_MEMORY_SIZE;
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
|
||||
@@ -105,4 +105,4 @@ HWTEST2_F(GfxCoreHelperXe2AndLaterTests, givenAtLeastXe2HpgWhenEncodeAdditionalT
|
||||
storeRegMem = genCmdCast<MI_STORE_REGISTER_MEM *>(*(++storeRegMemIt));
|
||||
EXPECT_EQ(storeRegMem->getRegisterAddress(), RegisterOffsets::globalTimestampUn);
|
||||
EXPECT_EQ(storeRegMem->getMemoryAddress(), sndAddress + sizeof(uint32_t));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2024 Intel Corporation
|
||||
* Copyright (C) 2018-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -300,3 +300,10 @@ HWTEST2_F(PreambleHwTest, GivenAtLeastXeHpCoreWhenPreambleAddsPipeControlBeforeC
|
||||
PreambleHelper<FamilyType>::addPipeControlBeforeVfeCmd(&stream, &hwInfo, EngineGroupType::compute);
|
||||
EXPECT_EQ(0u, stream.getUsed());
|
||||
}
|
||||
|
||||
HWTEST2_F(PreambleHwTest, givenHwWithForcedHeaplessModeWhenCallingSetSingleSliceDispatchModeThenDoNothing, IsAtLeastXeHpCore) {
|
||||
if (FamilyType::isHeaplessRequired() == false) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
PreambleHelper<FamilyType>::setSingleSliceDispatchMode(nullptr, true);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022-2024 Intel Corporation
|
||||
* Copyright (C) 2022-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -21,7 +21,7 @@ HWTEST_EXCLUDE_PRODUCT(MemoryManagerTests, givenEnabledLocalMemoryWhenLinearStre
|
||||
HWTEST_EXCLUDE_PRODUCT(MemoryManagerTests, givenEnabledLocalMemoryWhenAllocateKernelIsaInDevicePoolThenLocalMemoryPoolIsUsed, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(SbaTest, givenStateBaseAddressAndDebugFlagSetWhenAppendExtraCacheSettingsThenProgramCorrectL1CachePolicy_IsAtLeastXeHpgCore, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(XeHpgSbaTest, givenSpecificProductFamilyWhenAppendingSbaThenProgramWBPL1CachePolicy, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(GfxCoreHelperTest, GivenZeroSlmSizeWhenComputeSlmSizeIsCalledThenCorrectValueIsReturned, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(GfxCoreHelperTest, GivenZeroSlmSizeWhenComputeSlmSizeIsCalledThenCorrectValueIsReturned_IsHeapfulSupported, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(ProductHelperCommonTest, givenHwHelperWhenIsFusedEuDisabledForDpasCalledThenFalseReturned, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(ProductHelperCommonTest, givenProductHelperWhenCallingIsCalculationForDisablingEuFusionWithDpasNeededThenFalseReturned, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, whenDisableL3ForDebugCalledThenFalseIsReturned, IGFX_DG2);
|
||||
|
||||
Reference in New Issue
Block a user