From fd492f28b036f3fa1685ecfbef86e64f8c7e3d8a Mon Sep 17 00:00:00 2001 From: Mateusz Jablonski Date: Wed, 14 Oct 2020 15:40:57 +0200 Subject: [PATCH] Correct useSystemMemoryPlacementForISA Related-To: NEO-5156 Change-Id: Iee6df3e06eea5707b3b6cb45ac50e9880ee4dfb4 Signed-off-by: Mateusz Jablonski --- .../test/unit_test/helpers/hw_helper_tests.cpp | 17 +++++++++++++++-- shared/source/helpers/hw_helper_base.inl | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/opencl/test/unit_test/helpers/hw_helper_tests.cpp b/opencl/test/unit_test/helpers/hw_helper_tests.cpp index 255dbb05b2..f6c93f2c0c 100644 --- a/opencl/test/unit_test/helpers/hw_helper_tests.cpp +++ b/opencl/test/unit_test/helpers/hw_helper_tests.cpp @@ -1011,13 +1011,26 @@ TEST(HwInfoConfigCommonHelperTest, givenBlitterPreferenceWhenEnablingBlitterOper } HWTEST_F(HwHelperTest, givenHwHelperWhenAskingForIsaSystemMemoryPlacementThenReturnFalseIfLocalMemorySupported) { + DebugManagerStateRestore restorer; HwHelper &hwHelper = HwHelper::get(hardwareInfo.platform.eRenderCoreFamily); hardwareInfo.featureTable.ftrLocalMemory = true; - EXPECT_FALSE(hwHelper.useSystemMemoryPlacementForISA(hardwareInfo)); + auto localMemoryEnabled = hwHelper.getEnableLocalMemory(hardwareInfo); + EXPECT_NE(localMemoryEnabled, hwHelper.useSystemMemoryPlacementForISA(hardwareInfo)); hardwareInfo.featureTable.ftrLocalMemory = false; - EXPECT_TRUE(hwHelper.useSystemMemoryPlacementForISA(hardwareInfo)); + localMemoryEnabled = hwHelper.getEnableLocalMemory(hardwareInfo); + EXPECT_NE(localMemoryEnabled, hwHelper.useSystemMemoryPlacementForISA(hardwareInfo)); + + DebugManager.flags.EnableLocalMemory.set(true); + hardwareInfo.featureTable.ftrLocalMemory = false; + localMemoryEnabled = hwHelper.getEnableLocalMemory(hardwareInfo); + EXPECT_NE(localMemoryEnabled, hwHelper.useSystemMemoryPlacementForISA(hardwareInfo)); + + DebugManager.flags.EnableLocalMemory.set(false); + hardwareInfo.featureTable.ftrLocalMemory = true; + localMemoryEnabled = hwHelper.getEnableLocalMemory(hardwareInfo); + EXPECT_NE(localMemoryEnabled, hwHelper.useSystemMemoryPlacementForISA(hardwareInfo)); } TEST(HwInfoConfigCommonHelperTest, givenDebugFlagSetWhenEnablingBlitterOperationsSupportThenHonorTheFlag) { diff --git a/shared/source/helpers/hw_helper_base.inl b/shared/source/helpers/hw_helper_base.inl index 3bda8ed41e..bbf33bca60 100644 --- a/shared/source/helpers/hw_helper_base.inl +++ b/shared/source/helpers/hw_helper_base.inl @@ -517,7 +517,7 @@ bool HwHelperHw::useOnlyGlobalTimestamps() const { template bool HwHelperHw::useSystemMemoryPlacementForISA(const HardwareInfo &hwInfo) const { - return !hwInfo.featureTable.ftrLocalMemory; + return !getEnableLocalMemory(hwInfo); } template