From 166cdfedf58d01c07d89c878745b74e6b079d43e Mon Sep 17 00:00:00 2001 From: Compute-Runtime-Validation Date: Thu, 30 May 2024 02:32:39 +0200 Subject: [PATCH] Revert "refactor: Add dc flush mitigation infrastructure" This reverts commit f2d56744e3f196ad6bd4237d499b51b47f189512. Signed-off-by: Compute-Runtime-Validation --- opencl/test/unit_test/context/driver_diagnostics_tests.h | 3 --- shared/source/os_interface/product_helper.h | 1 - shared/source/os_interface/product_helper.inl | 7 +------ shared/source/os_interface/product_helper_hw.h | 1 - shared/test/common/mocks/mock_product_helper.cpp | 5 ----- shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp | 9 --------- .../test/unit_test/os_interface/product_helper_tests.cpp | 8 +++----- 7 files changed, 4 insertions(+), 30 deletions(-) diff --git a/opencl/test/unit_test/context/driver_diagnostics_tests.h b/opencl/test/unit_test/context/driver_diagnostics_tests.h index ab400797fe..143815ad90 100644 --- a/opencl/test/unit_test/context/driver_diagnostics_tests.h +++ b/opencl/test/unit_test/context/driver_diagnostics_tests.h @@ -212,9 +212,6 @@ struct PerformanceHintEnqueueMapTest : public PerformanceHintEnqueueTest, void SetUp() override { PerformanceHintEnqueueTest::SetUp(); - if (context->getDevice(0)->getRootDeviceEnvironment().getProductHelper().isDcFlushMitigated()) { - GTEST_SKIP(); - } } void TearDown() override { diff --git a/shared/source/os_interface/product_helper.h b/shared/source/os_interface/product_helper.h index 18b7f8030c..c1c69858fa 100644 --- a/shared/source/os_interface/product_helper.h +++ b/shared/source/os_interface/product_helper.h @@ -131,7 +131,6 @@ class ProductHelper { virtual bool isTile64With3DSurfaceOnBCSSupported(const HardwareInfo &hwInfo) const = 0; virtual bool isDcFlushAllowed() const = 0; virtual bool isDcFlushMitigated() const = 0; - virtual bool mitigateDcFlush() const = 0; virtual bool overridePatAndUsageForDcFlushMitigation(AllocationType allocationType) const = 0; virtual bool overrideCacheableForDcFlushMitigation(AllocationType allocationType) const = 0; virtual uint32_t computeMaxNeededSubSliceSpace(const HardwareInfo &hwInfo) const = 0; diff --git a/shared/source/os_interface/product_helper.inl b/shared/source/os_interface/product_helper.inl index 421d15424b..81f7b5aede 100644 --- a/shared/source/os_interface/product_helper.inl +++ b/shared/source/os_interface/product_helper.inl @@ -394,7 +394,7 @@ bool ProductHelperHw::isDisableScratchPagesSupported() const { template bool ProductHelperHw::isDcFlushAllowed() const { using GfxProduct = typename HwMapper::GfxProduct; - bool dcFlushAllowed = GfxProduct::isDcFlushAllowed && !this->mitigateDcFlush(); + bool dcFlushAllowed = GfxProduct::isDcFlushAllowed; if (debugManager.flags.AllowDcFlush.get() != -1) { dcFlushAllowed = debugManager.flags.AllowDcFlush.get(); @@ -403,11 +403,6 @@ bool ProductHelperHw::isDcFlushAllowed() const { return dcFlushAllowed; } -template -bool ProductHelperHw::mitigateDcFlush() const { - return false; -} - template bool ProductHelperHw::isDcFlushMitigated() const { using GfxProduct = typename HwMapper::GfxProduct; diff --git a/shared/source/os_interface/product_helper_hw.h b/shared/source/os_interface/product_helper_hw.h index 2a772c745a..407390cb81 100644 --- a/shared/source/os_interface/product_helper_hw.h +++ b/shared/source/os_interface/product_helper_hw.h @@ -76,7 +76,6 @@ class ProductHelperHw : public ProductHelper { bool isTile64With3DSurfaceOnBCSSupported(const HardwareInfo &hwInfo) const override; bool isDcFlushAllowed() const override; bool isDcFlushMitigated() const override; - bool mitigateDcFlush() const override; bool overridePatAndUsageForDcFlushMitigation(AllocationType allocationType) const override; bool overrideCacheableForDcFlushMitigation(AllocationType allocationType) const override; uint32_t computeMaxNeededSubSliceSpace(const HardwareInfo &hwInfo) const override; diff --git a/shared/test/common/mocks/mock_product_helper.cpp b/shared/test/common/mocks/mock_product_helper.cpp index c5b988214d..8630add1dd 100644 --- a/shared/test/common/mocks/mock_product_helper.cpp +++ b/shared/test/common/mocks/mock_product_helper.cpp @@ -281,11 +281,6 @@ bool ProductHelperHw::isDcFlushMitigated() const { return false; } -template <> -bool ProductHelperHw::mitigateDcFlush() const { - return false; -} - template <> bool ProductHelperHw::overridePatAndUsageForDcFlushMitigation(AllocationType allocationType) const { return false; diff --git a/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp b/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp index 1117ded1bf..6003873725 100644 --- a/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp +++ b/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp @@ -682,11 +682,6 @@ TEST(GmmTest, givenHwInfoWhenDeviceIsCreatedThenSetThisHwInfoToGmmHelper) { TEST(GmmTest, givenAllocationTypeWhenGettingUsageTypeThenReturnCorrectValue) { MockExecutionEnvironment mockExecutionEnvironment{}; const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); - - if (productHelper.isDcFlushMitigated()) { - GTEST_SKIP(); - } - for (uint32_t i = 0; i < static_cast(AllocationType::count); i++) { auto allocationType = static_cast(i); auto uncachedGmmUsageType = productHelper.isNewCoherencyModelSupported() ? GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC : GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED; @@ -881,10 +876,6 @@ TEST(GmmTest, givenUncachedDebugFlagMaskSetWhenAskingForUsageTypeThenReturnUncac MockExecutionEnvironment mockExecutionEnvironment{}; const auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[0]->getHelper(); - if (productHelper.isDcFlushMitigated()) { - GTEST_SKIP(); - } - constexpr int64_t bufferMask = 1 << (static_cast(AllocationType::buffer) - 1); constexpr int64_t imageMask = 1 << (static_cast(AllocationType::image) - 1); diff --git a/shared/test/unit_test/os_interface/product_helper_tests.cpp b/shared/test/unit_test/os_interface/product_helper_tests.cpp index 873efedff5..d7c3b28840 100644 --- a/shared/test/unit_test/os_interface/product_helper_tests.cpp +++ b/shared/test/unit_test/os_interface/product_helper_tests.cpp @@ -311,11 +311,9 @@ HWTEST_F(ProductHelperTest, givenVariousValuesWhenGettingAubStreamSteppingFromHw HWTEST_F(ProductHelperTest, givenDcFlushMitigationWhenOverridePatAndUsageForDcFlushMitigationThenReturnCorrectValue) { DebugManagerStateRestore restorer; - if (!productHelper->isDcFlushMitigated()) { - for (auto i = 0; i < static_cast(AllocationType::count); ++i) { - auto allocationType = static_cast(i); - EXPECT_FALSE(productHelper->overridePatAndUsageForDcFlushMitigation(allocationType)); - } + for (auto i = 0; i < static_cast(AllocationType::count); ++i) { + auto allocationType = static_cast(i); + EXPECT_FALSE(productHelper->overridePatAndUsageForDcFlushMitigation(allocationType)); } debugManager.flags.AllowDcFlush.set(0); for (auto i = 0; i < static_cast(AllocationType::count); ++i) {