mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
refactor: cleanup GfxCoreHelper
Remove GfxCoreHelper unused methods. Move test-specific types to test sources. 1) computeSlmValues: is not used in other places than tests. Remove it and unify tests placement 2) isForceDefaultRCSEngineWARequired, unTypedDataPortCacheFlushRequired, getMaxPtssIndex: unused, remove 3) DwordBuilder: only used in tests, remove it by tests refactoring Signed-off-by: Naklicki, Mateusz <mateusz.naklicki@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
91a27e9e9d
commit
a84629c8b3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
* Copyright (C) 2018-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -7,18 +7,12 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/helpers/constants.h"
|
||||
#include "shared/source/helpers/engine_node_helper.h"
|
||||
#include "shared/test/common/fixtures/device_fixture.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
using namespace NEO;
|
||||
|
||||
struct ComputeSlmTestInput {
|
||||
uint32_t expected;
|
||||
uint32_t slmSize;
|
||||
};
|
||||
|
||||
using GfxCoreHelperTest = Test<DeviceFixture>;
|
||||
|
||||
struct GfxCoreHelperTestWithEnginesCheck : public GfxCoreHelperTest {
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/source/command_container/encode_surface_state.h"
|
||||
#include "shared/source/gmm_helper/gmm_helper.h"
|
||||
#include "shared/source/helpers/bindless_heaps_helper.h"
|
||||
@@ -264,9 +265,8 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, CommandEncodeStatesTest, givenSlmTotalSizeGraterT
|
||||
EncodeDispatchKernel<FamilyType>::template encode<DefaultWalkerType>(*cmdContainer.get(), dispatchArgs);
|
||||
|
||||
auto interfaceDescriptorData = static_cast<INTERFACE_DESCRIPTOR_DATA *>(cmdContainer->getIddBlock());
|
||||
auto &gfxcoreHelper = this->getHelper<GfxCoreHelper>();
|
||||
uint32_t expectedValue = static_cast<typename INTERFACE_DESCRIPTOR_DATA::SHARED_LOCAL_MEMORY_SIZE>(
|
||||
gfxcoreHelper.computeSlmValues(pDevice->getHardwareInfo(), slmTotalSize, nullptr, false));
|
||||
EncodeDispatchKernel<FamilyType>::computeSlmValues(pDevice->getHardwareInfo(), slmTotalSize, nullptr, false));
|
||||
|
||||
EXPECT_EQ(expectedValue, interfaceDescriptorData->getSharedLocalMemorySize());
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/source/command_container/encode_surface_state.h"
|
||||
#include "shared/source/command_container/implicit_scaling.h"
|
||||
#include "shared/source/command_container/walker_partition_xehp_and_later.h"
|
||||
@@ -61,12 +62,11 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, CommandEncodeStatesTest, givenSlmTotalSizeGraterTha
|
||||
|
||||
auto cmd = genCmdCast<DefaultWalkerType *>(*itor);
|
||||
auto &idd = cmd->getInterfaceDescriptor();
|
||||
auto &gfxcoreHelper = this->getHelper<GfxCoreHelper>();
|
||||
auto releaseHelper = ReleaseHelper::create(pDevice->getHardwareInfo().ipVersion);
|
||||
bool isHeapless = pDevice->getCompilerProductHelper().isHeaplessModeEnabled(*defaultHwInfo);
|
||||
|
||||
uint32_t expectedValue = static_cast<typename INTERFACE_DESCRIPTOR_DATA::SHARED_LOCAL_MEMORY_SIZE>(
|
||||
gfxcoreHelper.computeSlmValues(pDevice->getHardwareInfo(), slmTotalSize, releaseHelper.get(), isHeapless));
|
||||
EncodeDispatchKernel<FamilyType>::computeSlmValues(pDevice->getHardwareInfo(), slmTotalSize, releaseHelper.get(), isHeapless));
|
||||
|
||||
EXPECT_EQ(expectedValue, idd.getSharedLocalMemorySize());
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
* Copyright (C) 2018-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -8,6 +8,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/command_stream/preemption_mode.h"
|
||||
#include "shared/source/helpers/bit_helpers.h"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
|
||||
@@ -61,5 +62,10 @@ struct PreemptionTestHwDetails {
|
||||
uint32_t defaultRegValue = 0;
|
||||
};
|
||||
|
||||
inline constexpr uint64_t preemptionModeMask = makeBitMask<17, 18>();
|
||||
inline constexpr uint32_t midThreadMode = static_cast<uint32_t>(preemptionModeMask);
|
||||
inline constexpr uint32_t threadGroupMode = static_cast<uint32_t>(setBits(preemptionModeMask, true, 0b10));
|
||||
inline constexpr uint32_t midBatchMode = static_cast<uint32_t>(setBits(preemptionModeMask, true, 0b100));
|
||||
|
||||
template <typename FamilyType>
|
||||
PreemptionTestHwDetails getPreemptionTestHwDetails();
|
||||
PreemptionTestHwDetails getPreemptionTestHwDetails();
|
||||
@@ -5,9 +5,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/source/helpers/gfx_core_helper.h"
|
||||
#include "shared/test/common/fixtures/device_fixture.h"
|
||||
#include "shared/test/common/helpers/gtest_helpers.h"
|
||||
#include "shared/test/common/test_macros/test.h"
|
||||
|
||||
using namespace NEO;
|
||||
@@ -67,3 +67,23 @@ GEN12LPTEST_F(Gen12LpDeviceCaps, givenGen12LpWhenCheckingCoherencySupportThenRet
|
||||
HWTEST2_F(Gen12LpDeviceCaps, givenTglLpWhenCheckSupportCacheFlushAfterWalkerThenFalse, IsTGLLP) {
|
||||
EXPECT_FALSE(pDevice->getHardwareInfo().capabilityTable.supportCacheFlushAfterWalker);
|
||||
}
|
||||
|
||||
GEN12LPTEST_F(Gen12LpDeviceCaps, givenSlmSizeWhenEncodingThenReturnCorrectValues) {
|
||||
const auto &hwInfo = pDevice->getHardwareInfo();
|
||||
|
||||
EXPECT_EQ(0u, EncodeDispatchKernel<FamilyType>::computeSlmValues(hwInfo, 0, nullptr, false));
|
||||
EXPECT_EQ(1u, EncodeDispatchKernel<FamilyType>::computeSlmValues(hwInfo, 1, nullptr, false));
|
||||
EXPECT_EQ(1u, EncodeDispatchKernel<FamilyType>::computeSlmValues(hwInfo, 1024, nullptr, false));
|
||||
EXPECT_EQ(2u, EncodeDispatchKernel<FamilyType>::computeSlmValues(hwInfo, 1025, nullptr, false));
|
||||
EXPECT_EQ(2u, EncodeDispatchKernel<FamilyType>::computeSlmValues(hwInfo, 2048, nullptr, false));
|
||||
EXPECT_EQ(3u, EncodeDispatchKernel<FamilyType>::computeSlmValues(hwInfo, 2049, nullptr, false));
|
||||
EXPECT_EQ(3u, EncodeDispatchKernel<FamilyType>::computeSlmValues(hwInfo, 4096, nullptr, false));
|
||||
EXPECT_EQ(4u, EncodeDispatchKernel<FamilyType>::computeSlmValues(hwInfo, 4097, nullptr, false));
|
||||
EXPECT_EQ(4u, EncodeDispatchKernel<FamilyType>::computeSlmValues(hwInfo, 8192, nullptr, false));
|
||||
EXPECT_EQ(5u, EncodeDispatchKernel<FamilyType>::computeSlmValues(hwInfo, 8193, nullptr, false));
|
||||
EXPECT_EQ(5u, EncodeDispatchKernel<FamilyType>::computeSlmValues(hwInfo, 16384, nullptr, false));
|
||||
EXPECT_EQ(6u, EncodeDispatchKernel<FamilyType>::computeSlmValues(hwInfo, 16385, nullptr, false));
|
||||
EXPECT_EQ(6u, EncodeDispatchKernel<FamilyType>::computeSlmValues(hwInfo, 32768, nullptr, false));
|
||||
EXPECT_EQ(7u, EncodeDispatchKernel<FamilyType>::computeSlmValues(hwInfo, 32769, nullptr, false));
|
||||
EXPECT_EQ(7u, EncodeDispatchKernel<FamilyType>::computeSlmValues(hwInfo, 65536, nullptr, false));
|
||||
}
|
||||
@@ -19,9 +19,9 @@ using namespace NEO;
|
||||
template <>
|
||||
PreemptionTestHwDetails getPreemptionTestHwDetails<Gen12LpFamily>() {
|
||||
PreemptionTestHwDetails ret;
|
||||
ret.modeToRegValueMap[PreemptionMode::ThreadGroup] = DwordBuilder::build(1, true) | DwordBuilder::build(2, true, false);
|
||||
ret.modeToRegValueMap[PreemptionMode::MidBatch] = DwordBuilder::build(2, true) | DwordBuilder::build(1, true, false);
|
||||
ret.modeToRegValueMap[PreemptionMode::MidThread] = DwordBuilder::build(2, true, false) | DwordBuilder::build(1, true, false);
|
||||
ret.modeToRegValueMap[PreemptionMode::ThreadGroup] = threadGroupMode;
|
||||
ret.modeToRegValueMap[PreemptionMode::MidBatch] = midBatchMode;
|
||||
ret.modeToRegValueMap[PreemptionMode::MidThread] = midThreadMode;
|
||||
ret.defaultRegValue = ret.modeToRegValueMap[PreemptionMode::MidBatch];
|
||||
ret.regAddress = 0x2580u;
|
||||
return ret;
|
||||
|
||||
@@ -169,49 +169,6 @@ TEST_F(GfxCoreHelperTest, whenGetGpuTimeStampInNSIsCalledThenTimestampIsMaskedBa
|
||||
}
|
||||
}
|
||||
|
||||
TEST(DwordBuilderTest, WhenSettingNonMaskedBitsThenOnlySelectedBitAreSet) {
|
||||
uint32_t dword = 0;
|
||||
|
||||
// expect non-masked bit 2
|
||||
uint32_t expectedDword = (1 << 2);
|
||||
dword = DwordBuilder::build(2, false, true, 0); // set 2nd bit
|
||||
EXPECT_EQ(expectedDword, dword);
|
||||
|
||||
// expect non-masked bits 2 and 3
|
||||
expectedDword |= (1 << 3);
|
||||
dword = DwordBuilder::build(3, false, true, dword); // set 3rd bit with init value
|
||||
EXPECT_EQ(expectedDword, dword);
|
||||
}
|
||||
|
||||
TEST(DwordBuilderTest, WhenSettingMaskedBitsThenOnlySelectedBitAreSet) {
|
||||
uint32_t dword = 0;
|
||||
|
||||
// expect masked bit 2
|
||||
uint32_t expectedDword = (1 << 2);
|
||||
expectedDword |= (1 << (2 + 16));
|
||||
dword = DwordBuilder::build(2, true, true, 0); // set 2nd bit (masked)
|
||||
EXPECT_EQ(expectedDword, dword);
|
||||
|
||||
// expect masked bits 2 and 3
|
||||
expectedDword |= (1 << 3);
|
||||
expectedDword |= (1 << (3 + 16));
|
||||
dword = DwordBuilder::build(3, true, true, dword); // set 3rd bit (masked) with init value
|
||||
EXPECT_EQ(expectedDword, dword);
|
||||
}
|
||||
|
||||
TEST(DwordBuilderTest, GivenDifferentBitValuesWhenSettingMaskedBitsThenOnlySelectedBitAreSet) {
|
||||
// expect only mask bit
|
||||
uint32_t expectedDword = 1 << (2 + 16);
|
||||
auto dword = DwordBuilder::build(2, true, false, 0);
|
||||
EXPECT_EQ(expectedDword, dword);
|
||||
|
||||
// expect masked bits 3
|
||||
expectedDword = (1 << 3);
|
||||
expectedDword |= (1 << (3 + 16));
|
||||
dword = DwordBuilder::build(3, true, true, 0);
|
||||
EXPECT_EQ(expectedDword, dword);
|
||||
}
|
||||
|
||||
using LriHelperTests = ::testing::Test;
|
||||
|
||||
HWTEST_F(LriHelperTests, givenAddressAndOffsetWhenHelperIsUsedThenProgramCmdStream) {
|
||||
@@ -1016,13 +973,6 @@ HWTEST_F(GfxCoreHelperTest, givenDefaultGfxCoreHelperHwWhenIsOffsetToSkipSetFFID
|
||||
EXPECT_FALSE(gfxCoreHelper.isOffsetToSkipSetFFIDGPWARequired(hardwareInfo, productHelper));
|
||||
}
|
||||
|
||||
HWTEST_F(GfxCoreHelperTest, givenDefaultGfxCoreHelperHwWhenIsForceDefaultRCSEngineWARequiredCalledThenFalseIsReturned) {
|
||||
if (hardwareInfo.platform.eRenderCoreFamily == IGFX_GEN12LP_CORE) {
|
||||
GTEST_SKIP();
|
||||
}
|
||||
EXPECT_FALSE(GfxCoreHelperHw<FamilyType>::isForceDefaultRCSEngineWARequired(hardwareInfo));
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_GEN12LP_CORE, GfxCoreHelperTest, givenDefaultGfxCoreHelperHwWhenIsWorkaroundRequiredCalledThenFalseIsReturned) {
|
||||
if (hardwareInfo.platform.eRenderCoreFamily == IGFX_GEN12LP_CORE) {
|
||||
GTEST_SKIP();
|
||||
@@ -1166,34 +1116,6 @@ HWCMDTEST_F(IGFX_GEN12LP_CORE, GfxCoreHelperTest, GivenVariousValuesWhenAlignSlm
|
||||
EXPECT_EQ(65536u, gfxCoreHelper.alignSlmSize(65536));
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_GEN12LP_CORE, GfxCoreHelperTest, GivenVariousValuesWhenComputeSlmSizeIsCalledThenCorrectValueIsReturned) {
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
EXPECT_EQ(0u, gfxCoreHelper.computeSlmValues(hwInfo, 0, nullptr, false));
|
||||
EXPECT_EQ(1u, gfxCoreHelper.computeSlmValues(hwInfo, 1, nullptr, false));
|
||||
EXPECT_EQ(1u, gfxCoreHelper.computeSlmValues(hwInfo, 1024, nullptr, false));
|
||||
EXPECT_EQ(2u, gfxCoreHelper.computeSlmValues(hwInfo, 1025, nullptr, false));
|
||||
EXPECT_EQ(2u, gfxCoreHelper.computeSlmValues(hwInfo, 2048, nullptr, false));
|
||||
EXPECT_EQ(3u, gfxCoreHelper.computeSlmValues(hwInfo, 2049, nullptr, false));
|
||||
EXPECT_EQ(3u, gfxCoreHelper.computeSlmValues(hwInfo, 4096, nullptr, false));
|
||||
EXPECT_EQ(4u, gfxCoreHelper.computeSlmValues(hwInfo, 4097, nullptr, false));
|
||||
EXPECT_EQ(4u, gfxCoreHelper.computeSlmValues(hwInfo, 8192, nullptr, false));
|
||||
EXPECT_EQ(5u, gfxCoreHelper.computeSlmValues(hwInfo, 8193, nullptr, false));
|
||||
EXPECT_EQ(5u, gfxCoreHelper.computeSlmValues(hwInfo, 16384, nullptr, false));
|
||||
EXPECT_EQ(6u, gfxCoreHelper.computeSlmValues(hwInfo, 16385, nullptr, false));
|
||||
EXPECT_EQ(6u, gfxCoreHelper.computeSlmValues(hwInfo, 32768, nullptr, false));
|
||||
EXPECT_EQ(7u, gfxCoreHelper.computeSlmValues(hwInfo, 32769, nullptr, false));
|
||||
EXPECT_EQ(7u, gfxCoreHelper.computeSlmValues(hwInfo, 65536, nullptr, false));
|
||||
}
|
||||
|
||||
HWTEST2_F(GfxCoreHelperTest, GivenZeroSlmSizeWhenComputeSlmSizeIsCalledThenCorrectValueIsReturned, IsHeapfulRequired) {
|
||||
using SHARED_LOCAL_MEMORY_SIZE = typename FamilyType::INTERFACE_DESCRIPTOR_DATA::SHARED_LOCAL_MEMORY_SIZE;
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
auto receivedSlmSize = static_cast<SHARED_LOCAL_MEMORY_SIZE>(gfxCoreHelper.computeSlmValues(hwInfo, 0, nullptr, false));
|
||||
EXPECT_EQ(SHARED_LOCAL_MEMORY_SIZE::SHARED_LOCAL_MEMORY_SIZE_SLM_ENCODES_0K, receivedSlmSize);
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_GEN12LP_CORE, GfxCoreHelperTest, givenGfxCoreHelperWhenGettingPlanarYuvHeightThenHelperReturnsCorrectValue) {
|
||||
auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
EXPECT_EQ(gfxCoreHelper.getPlanarYuvMaxHeight(), 16352u);
|
||||
@@ -1335,10 +1257,6 @@ HWTEST_F(GfxCoreHelperTest, whenIsSipKernelAsHexadecimalArrayPreferredIsCalledTh
|
||||
}
|
||||
|
||||
using isXeHpCoreOrBelow = IsAtMostProduct<IGFX_XE_HP_SDV>;
|
||||
HWTEST2_F(GfxCoreHelperTest, givenXeHPAndBelowPlatformWhenCheckingIfUnTypedDataPortCacheFlushRequiredThenReturnFalse, isXeHpCoreOrBelow) {
|
||||
const auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
EXPECT_FALSE(gfxCoreHelper.unTypedDataPortCacheFlushRequired());
|
||||
}
|
||||
|
||||
HWTEST2_F(GfxCoreHelperTest, givenXeHPAndBelowPlatformPlatformWhenCheckingIfEngineTypeRemappingIsRequiredThenReturnFalse, isXeHpCoreOrBelow) {
|
||||
const auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
@@ -1904,12 +1822,6 @@ HWTEST_F(GfxCoreHelperTest, givenEncodeDispatchKernelWhenUsingGfxHelperThenSameD
|
||||
EXPECT_EQ(requiredWalkOrder, helperRequiredWalkOrder);
|
||||
}
|
||||
|
||||
HWTEST_F(GfxCoreHelperTest, whenCallGetMaxPtssIndexThenCorrectValue) {
|
||||
auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
const auto &productHelper = getHelper<ProductHelper>();
|
||||
EXPECT_EQ(15u, gfxCoreHelper.getMaxPtssIndex(productHelper));
|
||||
}
|
||||
|
||||
HWTEST_F(GfxCoreHelperTest, whenEncodeAdditionalTimestampOffsetsThenNothingEncoded) {
|
||||
using MI_STORE_REGISTER_MEM = typename FamilyType::MI_STORE_REGISTER_MEM;
|
||||
constexpr static auto bufferSize = sizeof(MI_STORE_REGISTER_MEM);
|
||||
|
||||
@@ -173,12 +173,6 @@ HWTEST2_F(PipeControlHelperTestsDg2AndLater, givenDebugDisableCacheFlushWhenProg
|
||||
EXPECT_FALSE(pipeControl->getCompressionControlSurfaceCcsFlush());
|
||||
}
|
||||
|
||||
HWTEST2_F(GfxCoreHelperDg2AndLaterTest, givenXeHPGAndLaterPlatformWhenCheckingIfUnTypedDataPortCacheFlushRequiredThenReturnTrue, IsAtLeastXeCore) {
|
||||
MockExecutionEnvironment mockExecutionEnvironment{};
|
||||
auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<GfxCoreHelper>();
|
||||
EXPECT_TRUE(gfxCoreHelper.unTypedDataPortCacheFlushRequired());
|
||||
}
|
||||
|
||||
HWTEST2_F(GfxCoreHelperDg2AndLaterTest, givenGfxCoreHelperWhenCheckIsUpdateTaskCountFromWaitSupportedThenReturnsTrue, IsAtLeastXeCore) {
|
||||
MockExecutionEnvironment mockExecutionEnvironment{};
|
||||
auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<GfxCoreHelper>();
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/source/helpers/gfx_core_helper.h"
|
||||
#include "shared/source/xe2_hpg_core/hw_cmds.h"
|
||||
#include "shared/test/common/fixtures/device_fixture.h"
|
||||
#include "shared/test/common/helpers/gfx_core_helper_tests.h"
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
|
||||
|
||||
@@ -43,8 +43,12 @@ XE2_HPG_CORETEST_F(Xe2HpgCoreDeviceCaps, givenDeviceWhenAskingForSubGroupSizesTh
|
||||
}
|
||||
|
||||
XE2_HPG_CORETEST_F(Xe2HpgCoreDeviceCaps, givenSlmSizeWhenEncodingThenReturnCorrectValues) {
|
||||
struct ComputeSlmTestInput {
|
||||
uint32_t expected;
|
||||
uint32_t slmSize;
|
||||
};
|
||||
|
||||
const auto &hwInfo = pDevice->getHardwareInfo();
|
||||
auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
|
||||
ComputeSlmTestInput computeSlmValuesXe2AndLaterTestsInput[] = {
|
||||
{0, 0 * MemoryConstants::kiloByte},
|
||||
@@ -72,8 +76,8 @@ XE2_HPG_CORETEST_F(Xe2HpgCoreDeviceCaps, givenSlmSizeWhenEncodingThenReturnCorre
|
||||
{11, 128 * MemoryConstants::kiloByte}};
|
||||
|
||||
for (const auto &testInput : computeSlmValuesXe2AndLaterTestsInput) {
|
||||
EXPECT_EQ(testInput.expected, gfxCoreHelper.computeSlmValues(hwInfo, testInput.slmSize, nullptr, false));
|
||||
EXPECT_EQ(testInput.expected, EncodeDispatchKernel<FamilyType>::computeSlmValues(hwInfo, testInput.slmSize, nullptr, false));
|
||||
}
|
||||
|
||||
EXPECT_THROW(gfxCoreHelper.computeSlmValues(hwInfo, 128 * MemoryConstants::kiloByte + 1, nullptr, false), std::exception);
|
||||
EXPECT_THROW(EncodeDispatchKernel<FamilyType>::computeSlmValues(hwInfo, 128 * MemoryConstants::kiloByte + 1, nullptr, false), std::exception);
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/source/helpers/gfx_core_helper.h"
|
||||
#include "shared/test/common/fixtures/device_fixture.h"
|
||||
#include "shared/test/common/helpers/gfx_core_helper_tests.h"
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
|
||||
|
||||
@@ -55,8 +55,12 @@ XE3_CORETEST_F(Xe3CoreDeviceCaps, givenDeviceWhenAskingForSubGroupSizesThenRetur
|
||||
}
|
||||
|
||||
XE3_CORETEST_F(Xe3CoreDeviceCaps, givenSlmSizeWhenEncodingThenReturnCorrectValues) {
|
||||
struct ComputeSlmTestInput {
|
||||
uint32_t expected;
|
||||
uint32_t slmSize;
|
||||
};
|
||||
|
||||
const auto &hwInfo = pDevice->getHardwareInfo();
|
||||
auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
|
||||
ComputeSlmTestInput computeSlmValuesXe3AndLaterTestsInput[] = {
|
||||
{0, 0 * MemoryConstants::kiloByte},
|
||||
@@ -84,8 +88,8 @@ XE3_CORETEST_F(Xe3CoreDeviceCaps, givenSlmSizeWhenEncodingThenReturnCorrectValue
|
||||
{11, 128 * MemoryConstants::kiloByte}};
|
||||
|
||||
for (const auto &testInput : computeSlmValuesXe3AndLaterTestsInput) {
|
||||
EXPECT_EQ(testInput.expected, gfxCoreHelper.computeSlmValues(hwInfo, testInput.slmSize, nullptr, false));
|
||||
EXPECT_EQ(testInput.expected, EncodeDispatchKernel<FamilyType>::computeSlmValues(hwInfo, testInput.slmSize, nullptr, false));
|
||||
}
|
||||
|
||||
EXPECT_THROW(gfxCoreHelper.computeSlmValues(hwInfo, 128 * MemoryConstants::kiloByte + 1, nullptr, false), std::exception);
|
||||
EXPECT_THROW(EncodeDispatchKernel<FamilyType>::computeSlmValues(hwInfo, 128 * MemoryConstants::kiloByte + 1, nullptr, false), std::exception);
|
||||
}
|
||||
|
||||
@@ -20,43 +20,6 @@
|
||||
using namespace NEO;
|
||||
using GfxCoreHelperXeHpcCoreTest = ::testing::Test;
|
||||
|
||||
XE_HPC_CORETEST_F(GfxCoreHelperXeHpcCoreTest, givenSlmSizeWhenEncodingThenReturnCorrectValues) {
|
||||
ComputeSlmTestInput computeSlmValuesXeHpcTestsInput[] = {
|
||||
{0, 0 * MemoryConstants::kiloByte},
|
||||
{1, 0 * MemoryConstants::kiloByte + 1},
|
||||
{1, 1 * MemoryConstants::kiloByte},
|
||||
{2, 1 * MemoryConstants::kiloByte + 1},
|
||||
{2, 2 * MemoryConstants::kiloByte},
|
||||
{3, 2 * MemoryConstants::kiloByte + 1},
|
||||
{3, 4 * MemoryConstants::kiloByte},
|
||||
{4, 4 * MemoryConstants::kiloByte + 1},
|
||||
{4, 8 * MemoryConstants::kiloByte},
|
||||
{5, 8 * MemoryConstants::kiloByte + 1},
|
||||
{5, 16 * MemoryConstants::kiloByte},
|
||||
{8, 16 * MemoryConstants::kiloByte + 1},
|
||||
{8, 24 * MemoryConstants::kiloByte},
|
||||
{6, 24 * MemoryConstants::kiloByte + 1},
|
||||
{6, 32 * MemoryConstants::kiloByte},
|
||||
{9, 32 * MemoryConstants::kiloByte + 1},
|
||||
{9, 48 * MemoryConstants::kiloByte},
|
||||
{7, 48 * MemoryConstants::kiloByte + 1},
|
||||
{7, 64 * MemoryConstants::kiloByte},
|
||||
{10, 64 * MemoryConstants::kiloByte + 1},
|
||||
{10, 96 * MemoryConstants::kiloByte},
|
||||
{11, 96 * MemoryConstants::kiloByte + 1},
|
||||
{11, 128 * MemoryConstants::kiloByte}};
|
||||
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
MockExecutionEnvironment mockExecutionEnvironment{};
|
||||
auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<GfxCoreHelper>();
|
||||
|
||||
for (auto &testInput : computeSlmValuesXeHpcTestsInput) {
|
||||
EXPECT_EQ(testInput.expected, gfxCoreHelper.computeSlmValues(hwInfo, testInput.slmSize, nullptr, false));
|
||||
}
|
||||
|
||||
EXPECT_THROW(gfxCoreHelper.computeSlmValues(hwInfo, 129 * MemoryConstants::kiloByte, nullptr, false), std::exception);
|
||||
}
|
||||
|
||||
XE_HPC_CORETEST_F(GfxCoreHelperXeHpcCoreTest, WhenGettingIsCpuImageTransferPreferredThenTrueIsReturned) {
|
||||
MockExecutionEnvironment mockExecutionEnvironment{};
|
||||
auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper<GfxCoreHelper>();
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/source/helpers/gfx_core_helper.h"
|
||||
#include "shared/source/xe_hpc_core/hw_cmds.h"
|
||||
#include "shared/source/xe_hpc_core/hw_cmds_xe_hpc_core_base.h"
|
||||
#include "shared/test/common/fixtures/device_fixture.h"
|
||||
#include "shared/test/common/helpers/gfx_core_helper_tests.h"
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
|
||||
|
||||
@@ -42,3 +42,43 @@ XE_HPC_CORETEST_F(XeHpcCoreDeviceCaps, givenDeviceWhenAskingForSubGroupSizesThen
|
||||
EXPECT_EQ(16u, deviceSubgroups[0]);
|
||||
EXPECT_EQ(32u, deviceSubgroups[1]);
|
||||
}
|
||||
|
||||
XE_HPC_CORETEST_F(XeHpcCoreDeviceCaps, givenSlmSizeWhenEncodingThenReturnCorrectValues) {
|
||||
struct ComputeSlmTestInput {
|
||||
uint32_t expected;
|
||||
uint32_t slmSize;
|
||||
};
|
||||
|
||||
ComputeSlmTestInput computeSlmValuesXeHpcTestsInput[] = {
|
||||
{0, 0 * MemoryConstants::kiloByte},
|
||||
{1, 0 * MemoryConstants::kiloByte + 1},
|
||||
{1, 1 * MemoryConstants::kiloByte},
|
||||
{2, 1 * MemoryConstants::kiloByte + 1},
|
||||
{2, 2 * MemoryConstants::kiloByte},
|
||||
{3, 2 * MemoryConstants::kiloByte + 1},
|
||||
{3, 4 * MemoryConstants::kiloByte},
|
||||
{4, 4 * MemoryConstants::kiloByte + 1},
|
||||
{4, 8 * MemoryConstants::kiloByte},
|
||||
{5, 8 * MemoryConstants::kiloByte + 1},
|
||||
{5, 16 * MemoryConstants::kiloByte},
|
||||
{8, 16 * MemoryConstants::kiloByte + 1},
|
||||
{8, 24 * MemoryConstants::kiloByte},
|
||||
{6, 24 * MemoryConstants::kiloByte + 1},
|
||||
{6, 32 * MemoryConstants::kiloByte},
|
||||
{9, 32 * MemoryConstants::kiloByte + 1},
|
||||
{9, 48 * MemoryConstants::kiloByte},
|
||||
{7, 48 * MemoryConstants::kiloByte + 1},
|
||||
{7, 64 * MemoryConstants::kiloByte},
|
||||
{10, 64 * MemoryConstants::kiloByte + 1},
|
||||
{10, 96 * MemoryConstants::kiloByte},
|
||||
{11, 96 * MemoryConstants::kiloByte + 1},
|
||||
{11, 128 * MemoryConstants::kiloByte}};
|
||||
|
||||
auto hwInfo = *defaultHwInfo;
|
||||
|
||||
for (auto &testInput : computeSlmValuesXeHpcTestsInput) {
|
||||
EXPECT_EQ(testInput.expected, EncodeDispatchKernel<FamilyType>::computeSlmValues(hwInfo, testInput.slmSize, nullptr, false));
|
||||
}
|
||||
|
||||
EXPECT_THROW(EncodeDispatchKernel<FamilyType>::computeSlmValues(hwInfo, 129 * MemoryConstants::kiloByte, nullptr, false), std::exception);
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
* Copyright (C) 2021-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/gfx_core_helper.h"
|
||||
#include "shared/source/xe_hpc_core/hw_info_xe_hpc_core.h"
|
||||
#include "shared/test/unit_test/fixtures/preemption_fixture.h"
|
||||
|
||||
@@ -14,9 +13,9 @@ using namespace NEO;
|
||||
template <>
|
||||
PreemptionTestHwDetails getPreemptionTestHwDetails<XeHpcCoreFamily>() {
|
||||
PreemptionTestHwDetails ret;
|
||||
ret.modeToRegValueMap[PreemptionMode::ThreadGroup] = DwordBuilder::build(1, true) | DwordBuilder::build(2, true, false);
|
||||
ret.modeToRegValueMap[PreemptionMode::MidBatch] = DwordBuilder::build(2, true) | DwordBuilder::build(1, true, false);
|
||||
ret.modeToRegValueMap[PreemptionMode::MidThread] = DwordBuilder::build(2, true, false) | DwordBuilder::build(1, true, false);
|
||||
ret.modeToRegValueMap[PreemptionMode::ThreadGroup] = threadGroupMode;
|
||||
ret.modeToRegValueMap[PreemptionMode::MidBatch] = midBatchMode;
|
||||
ret.modeToRegValueMap[PreemptionMode::MidThread] = midThreadMode;
|
||||
ret.defaultRegValue = ret.modeToRegValueMap[PreemptionMode::MidBatch];
|
||||
ret.regAddress = 0x2580u;
|
||||
return ret;
|
||||
|
||||
@@ -20,7 +20,6 @@ HWTEST_EXCLUDE_PRODUCT(MemoryManagerTests, givenEnabledLocalMemoryWhenLinearStre
|
||||
HWTEST_EXCLUDE_PRODUCT(MemoryManagerTests, givenEnabledLocalMemoryWhenAllocateKernelIsaInDevicePoolThenLocalMemoryPoolIsUsed, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(SbaTest, givenStateBaseAddressAndDebugFlagSetWhenAppendExtraCacheSettingsThenProgramCorrectL1CachePolicy_IsSbaRequiredAndAtLeastXeCore, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(XeHpgSbaTest, givenSpecificProductFamilyWhenAppendingSbaThenProgramWBPL1CachePolicy, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(GfxCoreHelperTest, GivenZeroSlmSizeWhenComputeSlmSizeIsCalledThenCorrectValueIsReturned_IsHeapfulRequired, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(ProductHelperCommonTest, givenHwHelperWhenIsFusedEuDisabledForDpasCalledThenFalseReturned, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(ProductHelperCommonTest, givenProductHelperWhenCallingIsCalculationForDisablingEuFusionWithDpasNeededThenFalseReturned, IGFX_DG2);
|
||||
HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, whenDisableL3ForDebugCalledThenFalseIsReturned, IGFX_DG2);
|
||||
|
||||
@@ -263,31 +263,6 @@ XE_HPG_CORETEST_F(GfxCoreHelperTestXeHpgCore, givenGfxCoreHelperWhenCallCopyThro
|
||||
}
|
||||
}
|
||||
|
||||
constexpr ComputeSlmTestInput computeSlmValuesXeHpgTestsInput[] = {
|
||||
{0, 0 * MemoryConstants::kiloByte},
|
||||
{1, 0 * MemoryConstants::kiloByte + 1},
|
||||
{1, 1 * MemoryConstants::kiloByte},
|
||||
{2, 1 * MemoryConstants::kiloByte + 1},
|
||||
{2, 2 * MemoryConstants::kiloByte},
|
||||
{3, 2 * MemoryConstants::kiloByte + 1},
|
||||
{3, 4 * MemoryConstants::kiloByte},
|
||||
{4, 4 * MemoryConstants::kiloByte + 1},
|
||||
{4, 8 * MemoryConstants::kiloByte},
|
||||
{5, 8 * MemoryConstants::kiloByte + 1},
|
||||
{5, 16 * MemoryConstants::kiloByte},
|
||||
{6, 16 * MemoryConstants::kiloByte + 1},
|
||||
{6, 32 * MemoryConstants::kiloByte},
|
||||
{7, 32 * MemoryConstants::kiloByte + 1},
|
||||
{7, 64 * MemoryConstants::kiloByte}};
|
||||
|
||||
XE_HPG_CORETEST_F(GfxCoreHelperTestXeHpgCore, GivenVariousValuesWhenComputeSlmSizeIsCalledThenCorrectValueIsReturned) {
|
||||
const auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
|
||||
auto hardwareInfo = *defaultHwInfo;
|
||||
for (auto &testInput : computeSlmValuesXeHpgTestsInput) {
|
||||
EXPECT_EQ(testInput.expected, gfxCoreHelper.computeSlmValues(hardwareInfo, testInput.slmSize, nullptr, false));
|
||||
}
|
||||
}
|
||||
|
||||
using GfxCoreHelperTestsXeHpgCoreWithEnginesCheck = GfxCoreHelperTestWithEnginesCheck;
|
||||
|
||||
XE_HPG_CORETEST_F(GfxCoreHelperTestsXeHpgCoreWithEnginesCheck, whenGetEnginesCalledThenRegularCcsAndCccsAreNotAvailable) {
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/source/helpers/basic_math.h"
|
||||
#include "shared/source/xe_hpg_core/hw_cmds.h"
|
||||
#include "shared/source/xe_hpg_core/hw_cmds_xe_hpg_core_base.h"
|
||||
#include "shared/test/common/fixtures/device_fixture.h"
|
||||
#include "shared/test/common/helpers/gfx_core_helper_tests.h"
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/common/test_macros/header/per_product_test_definitions.h"
|
||||
|
||||
@@ -47,3 +47,32 @@ XE_HPG_CORETEST_F(XeHpgCoreDeviceCaps, givenEnabledFtrPooledEuAndNotA0SteppingWh
|
||||
|
||||
EXPECT_EQ(expectedMaxWGS, device->getDeviceInfo().maxWorkGroupSize);
|
||||
}
|
||||
|
||||
XE_HPG_CORETEST_F(XeHpgCoreDeviceCaps, GivenVariousValuesWhenComputeSlmSizeIsCalledThenCorrectValueIsReturned) {
|
||||
struct ComputeSlmTestInput {
|
||||
uint32_t expected;
|
||||
uint32_t slmSize;
|
||||
};
|
||||
|
||||
ComputeSlmTestInput computeSlmValuesXeHpgTestsInput[] = {
|
||||
{0, 0 * MemoryConstants::kiloByte},
|
||||
{1, 0 * MemoryConstants::kiloByte + 1},
|
||||
{1, 1 * MemoryConstants::kiloByte},
|
||||
{2, 1 * MemoryConstants::kiloByte + 1},
|
||||
{2, 2 * MemoryConstants::kiloByte},
|
||||
{3, 2 * MemoryConstants::kiloByte + 1},
|
||||
{3, 4 * MemoryConstants::kiloByte},
|
||||
{4, 4 * MemoryConstants::kiloByte + 1},
|
||||
{4, 8 * MemoryConstants::kiloByte},
|
||||
{5, 8 * MemoryConstants::kiloByte + 1},
|
||||
{5, 16 * MemoryConstants::kiloByte},
|
||||
{6, 16 * MemoryConstants::kiloByte + 1},
|
||||
{6, 32 * MemoryConstants::kiloByte},
|
||||
{7, 32 * MemoryConstants::kiloByte + 1},
|
||||
{7, 64 * MemoryConstants::kiloByte}};
|
||||
|
||||
auto hardwareInfo = *defaultHwInfo;
|
||||
for (auto &testInput : computeSlmValuesXeHpgTestsInput) {
|
||||
EXPECT_EQ(testInput.expected, EncodeDispatchKernel<FamilyType>::computeSlmValues(hardwareInfo, testInput.slmSize, nullptr, false));
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
/*
|
||||
* Copyright (C) 2021-2023 Intel Corporation
|
||||
* Copyright (C) 2021-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/helpers/gfx_core_helper.h"
|
||||
#include "shared/source/xe_hpg_core/hw_cmds_xe_hpg_core_base.h"
|
||||
#include "shared/test/unit_test/fixtures/preemption_fixture.h"
|
||||
|
||||
@@ -14,9 +13,9 @@ using namespace NEO;
|
||||
template <>
|
||||
PreemptionTestHwDetails getPreemptionTestHwDetails<XeHpgCoreFamily>() {
|
||||
PreemptionTestHwDetails ret;
|
||||
ret.modeToRegValueMap[PreemptionMode::ThreadGroup] = DwordBuilder::build(1, true) | DwordBuilder::build(2, true, false);
|
||||
ret.modeToRegValueMap[PreemptionMode::MidBatch] = DwordBuilder::build(2, true) | DwordBuilder::build(1, true, false);
|
||||
ret.modeToRegValueMap[PreemptionMode::MidThread] = DwordBuilder::build(2, true, false) | DwordBuilder::build(1, true, false);
|
||||
ret.modeToRegValueMap[PreemptionMode::ThreadGroup] = threadGroupMode;
|
||||
ret.modeToRegValueMap[PreemptionMode::MidBatch] = midBatchMode;
|
||||
ret.modeToRegValueMap[PreemptionMode::MidThread] = midThreadMode;
|
||||
ret.defaultRegValue = ret.modeToRegValueMap[PreemptionMode::MidBatch];
|
||||
ret.regAddress = 0x2580u;
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user