From ce0ccacef664bf8ac73281f699a63528dce9a71a Mon Sep 17 00:00:00 2001 From: Compute-Runtime-Validation Date: Sat, 25 May 2024 05:46:41 +0200 Subject: [PATCH] Revert "fix: Defer MOCS to PAT" This reverts commit 6c75ec31164f5321528f0a6b613d06f2afe9e3a2. Signed-off-by: Compute-Runtime-Validation --- .../sources/cmdlist/test_cmdlist_2.cpp | 8 ------ .../cmdlist/test_cmdlist_xehp_and_later.cpp | 8 ------ .../test/unit_test/mem_obj/buffer_tests.cpp | 3 --- .../command_stream/command_stream_receiver.h | 3 +-- .../source/gmm_helper/cache_settings_helper.h | 2 +- shared/source/gmm_helper/gmm_helper.cpp | 5 ---- .../windows/wddm_memory_manager.cpp | 4 --- .../command_stream_receiver_tests.cpp | 2 +- .../unit_test/gmm_helper/gmm_helper_tests.cpp | 27 ------------------- 9 files changed, 3 insertions(+), 59 deletions(-) diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp index 5b6e47a7e9..a3411fa37b 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_2.cpp @@ -1745,10 +1745,6 @@ HWTEST2_F(PrimaryBatchBufferPreamblelessCmdListTest, using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START; using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; - if (device->getProductHelper().isNewCoherencyModelSupported()) { - GTEST_SKIP(); - } - // command list 1 will have two kernels, transition from cached MOCS to uncached MOCS state ze_group_count_t groupCount{1, 1, 1}; CmdListKernelLaunchParams launchParams = {}; @@ -1923,10 +1919,6 @@ HWTEST2_F(PrimaryBatchBufferPreamblelessCmdListTest, using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START; using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; - if (device->getProductHelper().isNewCoherencyModelSupported()) { - GTEST_SKIP(); - } - auto ultCsr = static_cast *>(commandQueue->getCsr()); ultCsr->recordFlusheBatchBuffer = true; diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_xehp_and_later.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_xehp_and_later.cpp index c2125657f1..2fb0f76e68 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_xehp_and_later.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_xehp_and_later.cpp @@ -1914,10 +1914,6 @@ HWTEST2_F(ImmediateFlushTaskGlobalStatelessCmdListTest, IsAtLeastXeHpCore) { using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; - if (neoDevice->getProductHelper().isNewCoherencyModelSupported()) { - GTEST_SKIP(); - } - auto &csrImmediate = neoDevice->getUltCommandStreamReceiver(); auto &csrStream = csrImmediate.commandStream; @@ -2040,10 +2036,6 @@ HWTEST2_F(ImmediateFlushTaskCsrSharedHeapCmdListTest, IsAtLeastXeHpCore) { using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS; - if (neoDevice->getProductHelper().isNewCoherencyModelSupported()) { - GTEST_SKIP(); - } - auto &csrImmediate = neoDevice->getUltCommandStreamReceiver(); auto &csrStream = csrImmediate.commandStream; diff --git a/opencl/test/unit_test/mem_obj/buffer_tests.cpp b/opencl/test/unit_test/mem_obj/buffer_tests.cpp index a1281c269b..a824b20810 100644 --- a/opencl/test/unit_test/mem_obj/buffer_tests.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_tests.cpp @@ -2030,9 +2030,6 @@ HWTEST_P(BufferL3CacheTests, DISABLED_givenMisalignedAndAlignedBufferWhenClEnque HWTEST_P(BufferL3CacheTests, givenMisalignedAndAlignedBufferWhenClEnqueueWriteBufferRectThenL3CacheIsOn) { auto device = ctx.getDevice(0); - if (device->getProductHelper().isNewCoherencyModelSupported()) { - GTEST_SKIP(); - } const auto &compilerProductHelper = device->getRootDeviceEnvironment().getHelper(); if (compilerProductHelper.isForceToStatelessRequired()) { GTEST_SKIP(); diff --git a/shared/source/command_stream/command_stream_receiver.h b/shared/source/command_stream/command_stream_receiver.h index c8c3834159..e82400cdc3 100644 --- a/shared/source/command_stream/command_stream_receiver.h +++ b/shared/source/command_stream/command_stream_receiver.h @@ -9,7 +9,6 @@ #include "shared/source/command_stream/csr_definitions.h" #include "shared/source/command_stream/linear_stream.h" #include "shared/source/command_stream/stream_properties.h" -#include "shared/source/gmm_helper/cache_settings_helper.h" #include "shared/source/helpers/blit_properties_container.h" #include "shared/source/helpers/cache_policy.h" #include "shared/source/helpers/common_types.h" @@ -601,7 +600,7 @@ class CommandStreamReceiver { std::chrono::microseconds gpuHangCheckPeriod{500'000}; uint32_t lastSentL3Config = 0; - uint32_t latestSentStatelessMocsConfig = CacheSettings::unknownMocs; + uint32_t latestSentStatelessMocsConfig = 0; uint64_t lastSentSliceCount = QueueSliceCount::defaultSliceCount; uint32_t requiredScratchSlot0Size = 0; diff --git a/shared/source/gmm_helper/cache_settings_helper.h b/shared/source/gmm_helper/cache_settings_helper.h index c7684e6b4b..fb175c754d 100644 --- a/shared/source/gmm_helper/cache_settings_helper.h +++ b/shared/source/gmm_helper/cache_settings_helper.h @@ -9,7 +9,7 @@ #include "shared/source/gmm_helper/gmm_lib.h" namespace CacheSettings { -inline constexpr uint32_t unknownMocs = -1; +inline constexpr uint32_t unknownMocs = GMM_RESOURCE_USAGE_UNKNOWN; } // namespace CacheSettings namespace NEO { diff --git a/shared/source/gmm_helper/gmm_helper.cpp b/shared/source/gmm_helper/gmm_helper.cpp index 28f473b5d9..000511ba8f 100644 --- a/shared/source/gmm_helper/gmm_helper.cpp +++ b/shared/source/gmm_helper/gmm_helper.cpp @@ -15,7 +15,6 @@ #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/helpers/hw_info.h" #include "shared/source/memory_manager/graphics_allocation.h" -#include "shared/source/os_interface/product_helper.h" #include @@ -38,10 +37,6 @@ uint32_t GmmHelper::getMOCS(uint32_t type) const { type = GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED; } - if (this->rootDeviceEnvironment.getProductHelper().isNewCoherencyModelSupported()) { - return 0u; - } - MEMORY_OBJECT_CONTROL_STATE mocs = gmmClientContext->cachePolicyGetMemoryObject(nullptr, static_cast(type)); return static_cast(mocs.DwordValue); diff --git a/shared/source/os_interface/windows/wddm_memory_manager.cpp b/shared/source/os_interface/windows/wddm_memory_manager.cpp index 6773b1a80e..ad0a6483e5 100644 --- a/shared/source/os_interface/windows/wddm_memory_manager.cpp +++ b/shared/source/os_interface/windows/wddm_memory_manager.cpp @@ -447,10 +447,6 @@ GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryForNonSvmHostPtr(co GmmRequirements gmmRequirements{}; gmmRequirements.allowLargePages = true; gmmRequirements.preferCompressed = false; - if (productHelper.overrideAllocationCacheable(allocationData)) { - gmmRequirements.overriderCacheable.enableOverride = true; - gmmRequirements.overriderCacheable.value = true; - } auto gmm = new Gmm(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmHelper(), alignedPtr, alignedSize, 0u, CacheSettingsHelper::getGmmUsageType(wddmAllocation->getAllocationType(), !!allocationData.flags.uncacheable, productHelper), {}, gmmRequirements); diff --git a/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp b/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp index 7632f01978..dcc59f1a5b 100644 --- a/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp +++ b/shared/test/unit_test/command_stream/command_stream_receiver_tests.cpp @@ -338,7 +338,7 @@ HWTEST_F(CommandStreamReceiverTest, WhenCreatingCsrThenFlagsAreSetCorrectly) { EXPECT_EQ(0u, csr.lastSentL3Config); EXPECT_EQ(-1, csr.lastMediaSamplerConfig); EXPECT_EQ(PreemptionMode::Initial, csr.lastPreemptionMode); - EXPECT_EQ(static_cast(-1), csr.latestSentStatelessMocsConfig); + EXPECT_EQ(0u, csr.latestSentStatelessMocsConfig); } TEST_F(CommandStreamReceiverTest, givenBaseDownloadAllocationCalledThenDoesNotChangeAnything) { 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 6e49b3f01d..66caccb3a2 100644 --- a/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp +++ b/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp @@ -1044,35 +1044,11 @@ TEST(GmmHelperTest, givenEnableFtrTile64OptimizationDebugKeyWhenSetThenProperVal } } -TEST(GmmHelperTest, givenNewCoherencyModelWhenGetMocsThenDeferToPat) { - decltype(GmmHelper::createGmmContextWrapperFunc) createGmmContextSave = GmmHelper::createGmmContextWrapperFunc; - GmmHelper::createGmmContextWrapperFunc = GmmClientContext::create; - - MockExecutionEnvironment executionEnvironment{}; - if (!executionEnvironment.rootDeviceEnvironments[0]->getProductHelper().isNewCoherencyModelSupported()) { - GTEST_SKIP(); - } - auto gmmHelper = executionEnvironment.rootDeviceEnvironments[0]->getGmmHelper(); - - EXPECT_EQ(0u, gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED)); - EXPECT_EQ(0u, gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER)); - EXPECT_EQ(0u, gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_IMAGE)); - EXPECT_EQ(0u, gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_IMAGE_FROM_BUFFER)); - EXPECT_EQ(0u, gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CONST)); - EXPECT_EQ(0u, gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER)); - EXPECT_EQ(0u, gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_INLINE_CONST_HDC)); - - GmmHelper::createGmmContextWrapperFunc = createGmmContextSave; -} - TEST(GmmHelperTest, givenGmmHelperAndL3CacheDisabledForDebugThenCorrectMOCSIsReturned) { decltype(GmmHelper::createGmmContextWrapperFunc) createGmmContextSave = GmmHelper::createGmmContextWrapperFunc; GmmHelper::createGmmContextWrapperFunc = GmmClientContext::create; MockExecutionEnvironment executionEnvironment{}; - if (executionEnvironment.rootDeviceEnvironments[0]->getProductHelper().isNewCoherencyModelSupported()) { - GTEST_SKIP(); - } auto gmmHelper = executionEnvironment.rootDeviceEnvironments[0]->getGmmHelper(); auto uncachedMocs = gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED); @@ -1102,9 +1078,6 @@ TEST(GmmHelperTest, givenGmmHelperAndForceAllResourcesUncachedDebugVariableSetTh GmmHelper::createGmmContextWrapperFunc = GmmClientContext::create; MockExecutionEnvironment executionEnvironment{}; - if (executionEnvironment.rootDeviceEnvironments[0]->getProductHelper().isNewCoherencyModelSupported()) { - GTEST_SKIP(); - } auto gmmHelper = executionEnvironment.rootDeviceEnvironments[0]->getGmmHelper(); auto uncachedMocs = gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED);