From 293858320e64abc466d0cafa97a1ad4141a06426 Mon Sep 17 00:00:00 2001 From: Compute-Runtime-Validation Date: Sat, 2 Mar 2024 06:39:42 +0100 Subject: [PATCH] Revert "performance: Fill reusable allocation list on xe and later" This reverts commit 15934ceb43511b4d404e8e1597c116692f91b7b7. Signed-off-by: Compute-Runtime-Validation --- shared/source/helpers/gfx_core_helper_base.inl | 8 ++++++++ .../helpers/gfx_core_helper_bdw_and_later.inl | 8 -------- .../helpers/gfx_core_helper_xehp_and_later.inl | 8 -------- .../xe_hpc_core/gfx_core_helper_xe_hpc_core.cpp | 8 ++++++++ .../unit_test/helpers/gfx_core_helper_tests.cpp | 9 ++++++--- .../helpers/gfx_core_helper_tests_dg2_and_later.cpp | 13 ------------- 6 files changed, 22 insertions(+), 32 deletions(-) diff --git a/shared/source/helpers/gfx_core_helper_base.inl b/shared/source/helpers/gfx_core_helper_base.inl index 8ca636164b..1490dbbc19 100644 --- a/shared/source/helpers/gfx_core_helper_base.inl +++ b/shared/source/helpers/gfx_core_helper_base.inl @@ -681,6 +681,14 @@ bool GfxCoreHelperHw::copyThroughLockedPtrEnabled(const HardwareInfo return false; } +template +uint32_t GfxCoreHelperHw::getAmountOfAllocationsToFill() const { + if (debugManager.flags.SetAmountOfReusableAllocations.get() != -1) { + return debugManager.flags.SetAmountOfReusableAllocations.get(); + } + return 0u; +} + template bool GfxCoreHelperHw::isChipsetUniqueUUIDSupported() const { return false; diff --git a/shared/source/helpers/gfx_core_helper_bdw_and_later.inl b/shared/source/helpers/gfx_core_helper_bdw_and_later.inl index 142b8e94ee..3a6cef9d02 100644 --- a/shared/source/helpers/gfx_core_helper_bdw_and_later.inl +++ b/shared/source/helpers/gfx_core_helper_bdw_and_later.inl @@ -43,14 +43,6 @@ bool GfxCoreHelperHw::timestampPacketWriteSupported() const { return false; } -template -uint32_t GfxCoreHelperHw::getAmountOfAllocationsToFill() const { - if (debugManager.flags.SetAmountOfReusableAllocations.get() != -1) { - return debugManager.flags.SetAmountOfReusableAllocations.get(); - } - return 0u; -} - template bool GfxCoreHelperHw::isTimestampWaitSupportedForQueues() const { return false; diff --git a/shared/source/helpers/gfx_core_helper_xehp_and_later.inl b/shared/source/helpers/gfx_core_helper_xehp_and_later.inl index f4a32f4141..0b962abe1c 100644 --- a/shared/source/helpers/gfx_core_helper_xehp_and_later.inl +++ b/shared/source/helpers/gfx_core_helper_xehp_and_later.inl @@ -58,14 +58,6 @@ bool GfxCoreHelperHw::isTimestampWaitSupportedForQueues() const { return true; } -template -uint32_t GfxCoreHelperHw::getAmountOfAllocationsToFill() const { - if (debugManager.flags.SetAmountOfReusableAllocations.get() != -1) { - return debugManager.flags.SetAmountOfReusableAllocations.get(); - } - return 1u; -} - template bool GfxCoreHelperHw::makeResidentBeforeLockNeeded(bool precondition) const { return true; diff --git a/shared/source/xe_hpc_core/gfx_core_helper_xe_hpc_core.cpp b/shared/source/xe_hpc_core/gfx_core_helper_xe_hpc_core.cpp index 30bf591243..30d4b0c3a4 100644 --- a/shared/source/xe_hpc_core/gfx_core_helper_xe_hpc_core.cpp +++ b/shared/source/xe_hpc_core/gfx_core_helper_xe_hpc_core.cpp @@ -399,6 +399,14 @@ bool GfxCoreHelperHw::copyThroughLockedPtrEnabled(const HardwareInfo &hw return true; } +template <> +uint32_t GfxCoreHelperHw::getAmountOfAllocationsToFill() const { + if (debugManager.flags.SetAmountOfReusableAllocations.get() != -1) { + return debugManager.flags.SetAmountOfReusableAllocations.get(); + } + return 1u; +} + template <> bool GfxCoreHelperHw::isRelaxedOrderingSupported() const { return true; diff --git a/shared/test/unit_test/helpers/gfx_core_helper_tests.cpp b/shared/test/unit_test/helpers/gfx_core_helper_tests.cpp index b8efe0e535..2384918360 100644 --- a/shared/test/unit_test/helpers/gfx_core_helper_tests.cpp +++ b/shared/test/unit_test/helpers/gfx_core_helper_tests.cpp @@ -1347,6 +1347,11 @@ HWTEST2_F(GfxCoreHelperTest, givenGfxCoreHelperWhenCallCopyThroughLockedPtrEnabl EXPECT_FALSE(gfxCoreHelper.copyThroughLockedPtrEnabled(*defaultHwInfo, productHelper)); } +HWTEST2_F(GfxCoreHelperTest, givenGfxCoreHelperWhenCallGetAmountOfAllocationsToFillThenReturnFalse, IsNotXeHpcCore) { + const auto &gfxCoreHelper = getHelper(); + EXPECT_EQ(gfxCoreHelper.getAmountOfAllocationsToFill(), 0u); +} + HWTEST_F(GfxCoreHelperTest, givenGfxCoreHelperWhenFlagSetAndCallCopyThroughLockedPtrEnabledThenReturnCorrectValue) { DebugManagerStateRestore restorer; const auto &gfxCoreHelper = getHelper(); @@ -1358,11 +1363,9 @@ HWTEST_F(GfxCoreHelperTest, givenGfxCoreHelperWhenFlagSetAndCallCopyThroughLocke EXPECT_TRUE(gfxCoreHelper.copyThroughLockedPtrEnabled(*defaultHwInfo, productHelper)); } -HWTEST2_F(GfxCoreHelperTest, givenGfxCoreHelperWhenFlagSetAndCallGetAmountOfAllocationsToFillThenReturnCorrectValue, IsBeforeXeHpCore) { +HWTEST_F(GfxCoreHelperTest, givenGfxCoreHelperWhenFlagSetAndCallGetAmountOfAllocationsToFillThenReturnCorrectValue) { DebugManagerStateRestore restorer; const auto &gfxCoreHelper = getHelper(); - EXPECT_EQ(gfxCoreHelper.getAmountOfAllocationsToFill(), 0u); - debugManager.flags.SetAmountOfReusableAllocations.set(0); EXPECT_EQ(gfxCoreHelper.getAmountOfAllocationsToFill(), 0u); diff --git a/shared/test/unit_test/helpers/gfx_core_helper_tests_dg2_and_later.cpp b/shared/test/unit_test/helpers/gfx_core_helper_tests_dg2_and_later.cpp index 9c89de0aed..858893c57e 100644 --- a/shared/test/unit_test/helpers/gfx_core_helper_tests_dg2_and_later.cpp +++ b/shared/test/unit_test/helpers/gfx_core_helper_tests_dg2_and_later.cpp @@ -232,19 +232,6 @@ HWTEST2_F(GfxCoreHelperDg2AndLaterTest, givenGfxCoreHelperWhenCheckMakeResidentB EXPECT_TRUE(gfxCoreHelper.makeResidentBeforeLockNeeded(false)); } -HWTEST2_F(GfxCoreHelperDg2AndLaterTest, givenGfxCoreHelperWhenFlagSetAndCallGetAmountOfAllocationsToFillThenReturnCorrectValue, IsAtLeastXeHpgCore) { - DebugManagerStateRestore restorer; - MockExecutionEnvironment mockExecutionEnvironment{}; - auto &gfxCoreHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); - EXPECT_EQ(gfxCoreHelper.getAmountOfAllocationsToFill(), 1u); - - debugManager.flags.SetAmountOfReusableAllocations.set(0); - EXPECT_EQ(gfxCoreHelper.getAmountOfAllocationsToFill(), 0u); - - debugManager.flags.SetAmountOfReusableAllocations.set(1); - EXPECT_EQ(gfxCoreHelper.getAmountOfAllocationsToFill(), 1u); -} - using ProductHelperTestDg2AndLater = ::testing::Test; HWTEST2_F(ProductHelperTestDg2AndLater, givenDg2AndLaterPlatformWhenAskedIfHeapInLocalMemThenTrueIsReturned, IsAtLeastXeHpgCore) {