diff --git a/shared/source/gmm_helper/cache_settings_helper.cpp b/shared/source/gmm_helper/cache_settings_helper.cpp index dd7b648dde..2c1fbc7105 100644 --- a/shared/source/gmm_helper/cache_settings_helper.cpp +++ b/shared/source/gmm_helper/cache_settings_helper.cpp @@ -13,9 +13,9 @@ #include "shared/source/helpers/gfx_core_helper.h" #include "shared/source/helpers/hw_info.h" #include "shared/source/memory_manager/allocation_type.h" +#include "shared/source/memory_manager/graphics_allocation.h" #include "shared/source/os_interface/product_helper.h" #include "shared/source/release_helper/release_helper.h" - namespace NEO { GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getGmmUsageType(AllocationType allocationType, bool forceUncached, const ProductHelper &productHelper, const HardwareInfo *hwInfo) { @@ -60,7 +60,9 @@ GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getDefaultUsageTypeWithCaching } if (hwInfo->capabilityTable.isIntegratedDevice) { - if (AllocationType::semaphoreBuffer == allocationType || (AllocationType::ringBuffer == allocationType && productHelper.allowSharedResourcesInCoherentMemory())) { + if (productHelper.isResourceUncachedForCS(allocationType)) { + return GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC; + } else if (AllocationType::semaphoreBuffer == allocationType) { return GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; } } diff --git a/shared/source/memory_manager/graphics_allocation.h b/shared/source/memory_manager/graphics_allocation.h index c751a08500..2be17fa703 100644 --- a/shared/source/memory_manager/graphics_allocation.h +++ b/shared/source/memory_manager/graphics_allocation.h @@ -259,6 +259,12 @@ class GraphicsAllocation : public IDNode, NEO::NonCopyableAn type == AllocationType::profilingTagBuffer; } + static bool isAccessedFromCommandStreamer(AllocationType allocationType) { + return allocationType == AllocationType::commandBuffer || + allocationType == AllocationType::ringBuffer || + allocationType == AllocationType::semaphoreBuffer; + } + static uint32_t getNumHandlesForKmdSharedAllocation(uint32_t numBanks); void *getReservedAddressPtr() const { diff --git a/shared/source/os_interface/linux/drm_memory_manager.cpp b/shared/source/os_interface/linux/drm_memory_manager.cpp index 30ee3da5ee..cbe003d2ce 100644 --- a/shared/source/os_interface/linux/drm_memory_manager.cpp +++ b/shared/source/os_interface/linux/drm_memory_manager.cpp @@ -2058,7 +2058,7 @@ inline std::unique_ptr DrmMemoryManager::makeGmmIfSingleHandle(const Alloca gmmRequirements.allowLargePages = true; gmmRequirements.preferCompressed = allocationData.flags.preferCompressed; - if (productHelper.overrideAllocationCacheable(allocationData)) { + if (productHelper.overrideAllocationCpuCacheable(allocationData)) { gmmRequirements.overriderCacheable.enableOverride = true; gmmRequirements.overriderCacheable.value = true; } diff --git a/shared/source/os_interface/product_helper.h b/shared/source/os_interface/product_helper.h index fa7b82bced..fd2293562b 100644 --- a/shared/source/os_interface/product_helper.h +++ b/shared/source/os_interface/product_helper.h @@ -197,7 +197,7 @@ class ProductHelper { virtual uint32_t getMaxNumSamplers() const = 0; virtual uint32_t getCommandBuffersPreallocatedPerCommandQueue() const = 0; virtual uint32_t getInternalHeapsPreallocated() const = 0; - virtual bool overrideAllocationCacheable(const AllocationData &allocationData) const = 0; + virtual bool overrideAllocationCpuCacheable(const AllocationData &allocationData) const = 0; virtual bool is2MBLocalMemAlignmentEnabled() const = 0; virtual bool isPostImageWriteFlushRequired() const = 0; @@ -246,7 +246,7 @@ class ProductHelper { virtual std::optional getPreferredAllocationMethod(AllocationType allocationType) const = 0; virtual bool isCachingOnCpuAvailable() const = 0; virtual bool isNewCoherencyModelSupported() const = 0; - virtual bool allowSharedResourcesInCoherentMemory() const = 0; + virtual bool isResourceUncachedForCS(AllocationType allocationType) const = 0; virtual bool deferMOCSToPatIndex() const = 0; virtual const std::vector getSupportedLocalDispatchSizes(const HardwareInfo &hwInfo) const = 0; virtual uint32_t getMaxLocalRegionSize(const HardwareInfo &hwInfo) const = 0; diff --git a/shared/source/os_interface/product_helper.inl b/shared/source/os_interface/product_helper.inl index ab5e78e98f..bd9890c654 100644 --- a/shared/source/os_interface/product_helper.inl +++ b/shared/source/os_interface/product_helper.inl @@ -217,7 +217,7 @@ uint64_t ProductHelperHw::getDeviceMemoryMaxBandWidthInBytesPerSecon } template -bool ProductHelperHw::overrideAllocationCacheable(const AllocationData &allocationData) const { +bool ProductHelperHw::overrideAllocationCpuCacheable(const AllocationData &allocationData) const { return false; } diff --git a/shared/source/os_interface/product_helper_before_xe2.inl b/shared/source/os_interface/product_helper_before_xe2.inl index 94024a3826..af4c1fc28a 100644 --- a/shared/source/os_interface/product_helper_before_xe2.inl +++ b/shared/source/os_interface/product_helper_before_xe2.inl @@ -46,7 +46,7 @@ bool ProductHelperHw::isCompressionForbidden(const HardwareInfo &hwI } template -bool ProductHelperHw::allowSharedResourcesInCoherentMemory() const { +bool ProductHelperHw::isResourceUncachedForCS(AllocationType allocationType) const { return false; } diff --git a/shared/source/os_interface/product_helper_hw.h b/shared/source/os_interface/product_helper_hw.h index fcc916079e..dd7effb052 100644 --- a/shared/source/os_interface/product_helper_hw.h +++ b/shared/source/os_interface/product_helper_hw.h @@ -137,7 +137,7 @@ class ProductHelperHw : public ProductHelper { uint32_t getMaxNumSamplers() const override; uint32_t getCommandBuffersPreallocatedPerCommandQueue() const override; uint32_t getInternalHeapsPreallocated() const override; - bool overrideAllocationCacheable(const AllocationData &allocationData) const override; + bool overrideAllocationCpuCacheable(const AllocationData &allocationData) const override; bool is2MBLocalMemAlignmentEnabled() const override; bool isPostImageWriteFlushRequired() const override; @@ -184,7 +184,7 @@ class ProductHelperHw : public ProductHelper { std::optional getPreferredAllocationMethod(AllocationType allocationType) const override; bool isCachingOnCpuAvailable() const override; bool isNewCoherencyModelSupported() const override; - bool allowSharedResourcesInCoherentMemory() const override; + bool isResourceUncachedForCS(AllocationType allocationType) const override; bool deferMOCSToPatIndex() const override; bool supportReadOnlyAllocations() const override; const std::vector getSupportedLocalDispatchSizes(const HardwareInfo &hwInfo) const override; diff --git a/shared/source/os_interface/product_helper_xe2_and_later.inl b/shared/source/os_interface/product_helper_xe2_and_later.inl index 08a84fd3a0..e7065105b7 100644 --- a/shared/source/os_interface/product_helper_xe2_and_later.inl +++ b/shared/source/os_interface/product_helper_xe2_and_later.inl @@ -6,7 +6,6 @@ */ #include "shared/source/os_interface/product_helper_hw.h" - namespace NEO { template @@ -50,8 +49,8 @@ bool ProductHelperHw::isCompressionForbidden(const HardwareInfo &hwI } template -bool ProductHelperHw::allowSharedResourcesInCoherentMemory() const { - return true; +bool ProductHelperHw::isResourceUncachedForCS(AllocationType allocationType) const { + return GraphicsAllocation::isAccessedFromCommandStreamer(allocationType); } } // namespace NEO diff --git a/shared/source/os_interface/windows/wddm_memory_manager.cpp b/shared/source/os_interface/windows/wddm_memory_manager.cpp index 669cd7ecc3..3ba853279c 100644 --- a/shared/source/os_interface/windows/wddm_memory_manager.cpp +++ b/shared/source/os_interface/windows/wddm_memory_manager.cpp @@ -237,7 +237,7 @@ GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryUsingKmdAndMapItToC GmmRequirements gmmRequirements{}; gmmRequirements.allowLargePages = allowLargePages; gmmRequirements.preferCompressed = allocationData.flags.preferCompressed; - if (productHelper.overrideAllocationCacheable(allocationData)) { + if (productHelper.overrideAllocationCpuCacheable(allocationData)) { gmmRequirements.overriderCacheable.enableOverride = true; gmmRequirements.overriderCacheable.value = true; } @@ -467,7 +467,7 @@ GraphicsAllocation *WddmMemoryManager::allocateGraphicsMemoryForNonSvmHostPtr(co GmmRequirements gmmRequirements{}; gmmRequirements.allowLargePages = true; gmmRequirements.preferCompressed = false; - if (productHelper.overrideAllocationCacheable(allocationData)) { + if (productHelper.overrideAllocationCpuCacheable(allocationData)) { gmmRequirements.overriderCacheable.enableOverride = true; gmmRequirements.overriderCacheable.value = true; } diff --git a/shared/source/xe2_hpg_core/lnl/os_agnostic_product_helper_lnl.inl b/shared/source/xe2_hpg_core/lnl/os_agnostic_product_helper_lnl.inl index 14c4aa55c7..ea45ccbf6b 100644 --- a/shared/source/xe2_hpg_core/lnl/os_agnostic_product_helper_lnl.inl +++ b/shared/source/xe2_hpg_core/lnl/os_agnostic_product_helper_lnl.inl @@ -14,8 +14,8 @@ namespace NEO { template <> -bool ProductHelperHw::overrideAllocationCacheable(const AllocationData &allocationData) const { - return allocationData.type == AllocationType::commandBuffer || this->overrideCacheableForDcFlushMitigation(allocationData.type); +bool ProductHelperHw::overrideAllocationCpuCacheable(const AllocationData &allocationData) const { + return GraphicsAllocation::isAccessedFromCommandStreamer(allocationData.type) || this->overrideCacheableForDcFlushMitigation(allocationData.type); } template <> diff --git a/shared/source/xe3_core/ptl/os_agnostic_product_helper_ptl.inl b/shared/source/xe3_core/ptl/os_agnostic_product_helper_ptl.inl index 80f181a579..a384b1756a 100644 --- a/shared/source/xe3_core/ptl/os_agnostic_product_helper_ptl.inl +++ b/shared/source/xe3_core/ptl/os_agnostic_product_helper_ptl.inl @@ -10,8 +10,8 @@ namespace NEO { template <> -bool ProductHelperHw::overrideAllocationCacheable(const AllocationData &allocationData) const { - return allocationData.type == AllocationType::commandBuffer || this->overrideCacheableForDcFlushMitigation(allocationData.type); +bool ProductHelperHw::overrideAllocationCpuCacheable(const AllocationData &allocationData) const { + return GraphicsAllocation::isAccessedFromCommandStreamer(allocationData.type) || this->overrideCacheableForDcFlushMitigation(allocationData.type); } template <> diff --git a/shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl b/shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl index 81766911f7..77818705f6 100644 --- a/shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl +++ b/shared/source/xe_hpg_core/xe_lpg/os_agnostic_product_helper_xe_lpg.inl @@ -51,7 +51,7 @@ bool ProductHelperHw::isResolveDependenciesByPipeControlsSupported(c } template <> -bool ProductHelperHw::overrideAllocationCacheable(const AllocationData &allocationData) const { +bool ProductHelperHw::overrideAllocationCpuCacheable(const AllocationData &allocationData) const { return allocationData.type == AllocationType::commandBuffer; } diff --git a/shared/test/common/mocks/mock_product_helper.cpp b/shared/test/common/mocks/mock_product_helper.cpp index 52b84f9f93..17cfb61aa7 100644 --- a/shared/test/common/mocks/mock_product_helper.cpp +++ b/shared/test/common/mocks/mock_product_helper.cpp @@ -509,7 +509,7 @@ template <> void ProductHelperHw::setRenderCompressedFlags(HardwareInfo &hwInfo) const {} template <> -bool ProductHelperHw::allowSharedResourcesInCoherentMemory() const { +bool ProductHelperHw::isResourceUncachedForCS(AllocationType allocationType) const { return false; } diff --git a/shared/test/common/mocks/mock_product_helper.h b/shared/test/common/mocks/mock_product_helper.h index a495b8050a..249e22a545 100644 --- a/shared/test/common/mocks/mock_product_helper.h +++ b/shared/test/common/mocks/mock_product_helper.h @@ -17,7 +17,7 @@ struct MockProductHelper : ProductHelperHw { MockProductHelper() = default; ADDMETHOD_CONST_NOBASE(is48bResourceNeededForRayTracing, bool, true, ()); - ADDMETHOD_CONST_NOBASE(overrideAllocationCacheable, bool, false, (const AllocationData &allocationData)); + ADDMETHOD_CONST_NOBASE(overrideAllocationCpuCacheable, bool, false, (const AllocationData &allocationData)); ADDMETHOD_NOBASE(configureHwInfoWddm, int, 0, (const HardwareInfo *inHwInfo, HardwareInfo *outHwInfo, const RootDeviceEnvironment &rootDeviceEnvironment)); ADDMETHOD_CONST_NOBASE(supportReadOnlyAllocations, bool, false, ()); ADDMETHOD_CONST_NOBASE(isBlitCopyRequiredForLocalMemory, bool, true, (const RootDeviceEnvironment &rootDeviceEnvironment, const GraphicsAllocation &allocation)); 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 a8967fc555..a0d6f6413a 100644 --- a/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp +++ b/shared/test/unit_test/gmm_helper/gmm_helper_tests.cpp @@ -766,19 +766,23 @@ TEST(GmmTest, givenAllocationTypeWhenGettingUsageTypeThenReturnCorrectValue) { case AllocationType::fillPattern: case AllocationType::internalHostMemory: case AllocationType::mapAllocation: - case AllocationType::semaphoreBuffer: case AllocationType::svmCpu: case AllocationType::svmZeroCopy: case AllocationType::tagBuffer: expectedUsage = forceUncached ? uncachedGmmUsageType : GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; break; + case AllocationType::semaphoreBuffer: case AllocationType::ringBuffer: + case AllocationType::commandBuffer: if (forceUncached) { expectedUsage = uncachedGmmUsageType; break; } - if (productHelper.allowSharedResourcesInCoherentMemory()) { + if (productHelper.isResourceUncachedForCS(allocationType)) { + expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC; + break; + } else if (allocationType == AllocationType::semaphoreBuffer) { expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; break; } @@ -904,11 +908,15 @@ TEST(GmmTest, givenAllocationTypeAndMitigatedDcFlushWhenGettingUsageTypeThenRetu expectedUsage = GMM_RESOURCE_USAGE_OCL_IMAGE; break; case AllocationType::fillPattern: - case AllocationType::semaphoreBuffer: expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; break; + case AllocationType::semaphoreBuffer: case AllocationType::ringBuffer: - if (productHelper.allowSharedResourcesInCoherentMemory()) { + case AllocationType::commandBuffer: + if (productHelper.isResourceUncachedForCS(allocationType)) { + expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC; + break; + } else if (allocationType == AllocationType::semaphoreBuffer) { expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; break; } @@ -934,14 +942,18 @@ TEST(GmmTest, givenAllocationTypeAndMitigatedDcFlushWhenGettingUsageTypeThenRetu case AllocationType::fillPattern: case AllocationType::internalHostMemory: case AllocationType::mapAllocation: - case AllocationType::semaphoreBuffer: case AllocationType::svmCpu: case AllocationType::svmZeroCopy: case AllocationType::tagBuffer: expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; break; + case AllocationType::semaphoreBuffer: case AllocationType::ringBuffer: - if (productHelper.allowSharedResourcesInCoherentMemory()) { + case AllocationType::commandBuffer: + if (productHelper.isResourceUncachedForCS(allocationType)) { + expectedUsage = GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC; + break; + } else if (allocationType == AllocationType::semaphoreBuffer) { expectedUsage = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; break; } 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 0edbdd7db0..eefdce14cc 100644 --- a/shared/test/unit_test/os_interface/product_helper_tests.cpp +++ b/shared/test/unit_test/os_interface/product_helper_tests.cpp @@ -1181,10 +1181,22 @@ HWTEST_F(ProductHelperTest, givenProductHelperWhenCallingUseAdditionalBlitProper EXPECT_FALSE(productHelper->useAdditionalBlitProperties()); } -HWTEST2_F(ProductHelperTest, givenProductHelperWhenCallingAllowSharedResourcesInCoherentMemoryThenFalseReturned, IsBeforeXe2HpgCore) { - EXPECT_FALSE(productHelper->allowSharedResourcesInCoherentMemory()); +HWTEST2_F(ProductHelperTest, givenProductHelperWhenCallingIsResourceUncachedForCSThenFalseReturned, IsBeforeXe2HpgCore) { + for (uint32_t i = 0; i < static_cast(AllocationType::count); i++) { + auto allocationType = static_cast(i); + EXPECT_FALSE(productHelper->isResourceUncachedForCS(allocationType)); + } } -HWTEST2_F(ProductHelperTest, givenProductHelperWhenCallingAllowSharedResourcesInCoherentMemoryThenTrueReturned, IsAtLeastXe2HpgCore) { - EXPECT_TRUE(productHelper->allowSharedResourcesInCoherentMemory()); +HWTEST2_F(ProductHelperTest, givenProductHelperWhenCallingIsResourceUncachedForCSThenTrueReturned, IsAtLeastXe2HpgCore) { + for (uint32_t i = 0; i < static_cast(AllocationType::count); i++) { + auto allocationType = static_cast(i); + if (allocationType == AllocationType::commandBuffer || + allocationType == AllocationType::ringBuffer || + allocationType == AllocationType::semaphoreBuffer) { + EXPECT_TRUE(productHelper->isResourceUncachedForCS(allocationType)); + } else { + EXPECT_FALSE(productHelper->isResourceUncachedForCS(allocationType)); + } + } } diff --git a/shared/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp b/shared/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp index 6d2a08da75..eaabb617f1 100644 --- a/shared/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp +++ b/shared/test/unit_test/os_interface/windows/wddm_memory_manager_tests.cpp @@ -142,11 +142,11 @@ TEST_F(WddmMemoryManagerTests, GivenNotCompressedAndNotLockableAllocationTypeWhe memoryManager->freeGraphicsMemory(graphicsAllocation); } -TEST_F(WddmMemoryManagerTests, GivenOverrideAllocationCacheableWhenAllocateUsingKmdAndMapToCpuVaThenOverrideAllocationCacheable) { +TEST_F(WddmMemoryManagerTests, GivenoverrideAllocationCpuCacheableWhenAllocateUsingKmdAndMapToCpuVaThenoverrideAllocationCpuCacheable) { NEO::AllocationData allocData = {}; allocData.type = NEO::AllocationType::commandBuffer; auto mockProductHelper = std::make_unique(); - mockProductHelper->overrideAllocationCacheableResult = true; + mockProductHelper->overrideAllocationCpuCacheableResult = true; executionEnvironment->rootDeviceEnvironments[0]->productHelper.reset(mockProductHelper.release()); memoryManager->callBaseAllocateGraphicsMemoryUsingKmdAndMapItToCpuVA = true; diff --git a/shared/test/unit_test/xe2_hpg_core/lnl/product_helper_tests_lnl.cpp b/shared/test/unit_test/xe2_hpg_core/lnl/product_helper_tests_lnl.cpp index 0170c74a2a..9a72131867 100644 --- a/shared/test/unit_test/xe2_hpg_core/lnl/product_helper_tests_lnl.cpp +++ b/shared/test/unit_test/xe2_hpg_core/lnl/product_helper_tests_lnl.cpp @@ -108,13 +108,13 @@ LNLTEST_F(LnlProductHelper, givenProductHelperWhenCallIsCachingOnCpuAvailableThe EXPECT_FALSE(productHelper->isCachingOnCpuAvailable()); } -LNLTEST_F(LnlProductHelper, givenProductHelperWhenCheckOverrideAllocationCacheableThenTrueIsReturnedForCommandBuffer) { +LNLTEST_F(LnlProductHelper, givenProductHelperWhenCheckoverrideAllocationCpuCacheableThenTrueIsReturnedForCommandBuffer) { AllocationData allocationData{}; allocationData.type = AllocationType::commandBuffer; - EXPECT_TRUE(productHelper->overrideAllocationCacheable(allocationData)); + EXPECT_TRUE(productHelper->overrideAllocationCpuCacheable(allocationData)); allocationData.type = AllocationType::buffer; - EXPECT_FALSE(productHelper->overrideAllocationCacheable(allocationData)); + EXPECT_FALSE(productHelper->overrideAllocationCpuCacheable(allocationData)); } LNLTEST_F(LnlProductHelper, givenExternalHostPtrWhenMitigateDcFlushThenOverrideCacheable) { @@ -123,7 +123,7 @@ LNLTEST_F(LnlProductHelper, givenExternalHostPtrWhenMitigateDcFlushThenOverrideC AllocationData allocationData{}; allocationData.type = AllocationType::externalHostPtr; - EXPECT_FALSE(productHelper->overrideAllocationCacheable(allocationData)); + EXPECT_FALSE(productHelper->overrideAllocationCpuCacheable(allocationData)); debugManager.flags.AllowDcFlush.set(0); @@ -132,7 +132,9 @@ LNLTEST_F(LnlProductHelper, givenExternalHostPtrWhenMitigateDcFlushThenOverrideC allocationData.type = allocationType; switch (allocationData.type) { case AllocationType::commandBuffer: - EXPECT_TRUE(productHelper->overrideAllocationCacheable(allocationData)); + case AllocationType::ringBuffer: + case AllocationType::semaphoreBuffer: + EXPECT_TRUE(productHelper->overrideAllocationCpuCacheable(allocationData)); break; case AllocationType::externalHostPtr: case AllocationType::bufferHostMemory: @@ -141,11 +143,11 @@ LNLTEST_F(LnlProductHelper, givenExternalHostPtrWhenMitigateDcFlushThenOverrideC case AllocationType::svmZeroCopy: case AllocationType::internalHostMemory: case AllocationType::printfSurface: - EXPECT_TRUE(productHelper->overrideAllocationCacheable(allocationData)); + EXPECT_TRUE(productHelper->overrideAllocationCpuCacheable(allocationData)); EXPECT_TRUE(productHelper->overrideCacheableForDcFlushMitigation(allocationData.type)); break; default: - EXPECT_FALSE(productHelper->overrideAllocationCacheable(allocationData)); + EXPECT_FALSE(productHelper->overrideAllocationCpuCacheable(allocationData)); EXPECT_FALSE(productHelper->overrideCacheableForDcFlushMitigation(allocationData.type)); break; } diff --git a/shared/test/unit_test/xe3_core/ptl/product_helper_tests_ptl.cpp b/shared/test/unit_test/xe3_core/ptl/product_helper_tests_ptl.cpp index 2d3a88a6db..c08dbadab0 100644 --- a/shared/test/unit_test/xe3_core/ptl/product_helper_tests_ptl.cpp +++ b/shared/test/unit_test/xe3_core/ptl/product_helper_tests_ptl.cpp @@ -46,13 +46,13 @@ PTLTEST_F(PtlProductHelper, givenProductHelperWhenCheckDirectSubmissionSupported EXPECT_TRUE(productHelper->isDirectSubmissionSupported(releaseHelper)); } -PTLTEST_F(PtlProductHelper, givenProductHelperWhenCheckOverrideAllocationCacheableThenTrueIsReturnedForCommandBuffer) { +PTLTEST_F(PtlProductHelper, givenProductHelperWhenCheckoverrideAllocationCpuCacheableThenTrueIsReturnedForCommandBuffer) { AllocationData allocationData{}; allocationData.type = AllocationType::commandBuffer; - EXPECT_TRUE(productHelper->overrideAllocationCacheable(allocationData)); + EXPECT_TRUE(productHelper->overrideAllocationCpuCacheable(allocationData)); allocationData.type = AllocationType::buffer; - EXPECT_FALSE(productHelper->overrideAllocationCacheable(allocationData)); + EXPECT_FALSE(productHelper->overrideAllocationCpuCacheable(allocationData)); } PTLTEST_F(PtlProductHelper, givenExternalHostPtrWhenMitigateDcFlushThenOverrideCacheable) { @@ -61,7 +61,7 @@ PTLTEST_F(PtlProductHelper, givenExternalHostPtrWhenMitigateDcFlushThenOverrideC AllocationData allocationData{}; allocationData.type = AllocationType::externalHostPtr; - EXPECT_FALSE(productHelper->overrideAllocationCacheable(allocationData)); + EXPECT_FALSE(productHelper->overrideAllocationCpuCacheable(allocationData)); debugManager.flags.AllowDcFlush.set(0); @@ -70,7 +70,9 @@ PTLTEST_F(PtlProductHelper, givenExternalHostPtrWhenMitigateDcFlushThenOverrideC allocationData.type = allocationType; switch (allocationData.type) { case AllocationType::commandBuffer: - EXPECT_TRUE(productHelper->overrideAllocationCacheable(allocationData)); + case AllocationType::ringBuffer: + case AllocationType::semaphoreBuffer: + EXPECT_TRUE(productHelper->overrideAllocationCpuCacheable(allocationData)); break; case AllocationType::externalHostPtr: case AllocationType::bufferHostMemory: @@ -79,11 +81,11 @@ PTLTEST_F(PtlProductHelper, givenExternalHostPtrWhenMitigateDcFlushThenOverrideC case AllocationType::svmZeroCopy: case AllocationType::internalHostMemory: case AllocationType::printfSurface: - EXPECT_TRUE(productHelper->overrideAllocationCacheable(allocationData)); + EXPECT_TRUE(productHelper->overrideAllocationCpuCacheable(allocationData)); EXPECT_TRUE(productHelper->overrideCacheableForDcFlushMitigation(allocationData.type)); break; default: - EXPECT_FALSE(productHelper->overrideAllocationCacheable(allocationData)); + EXPECT_FALSE(productHelper->overrideAllocationCpuCacheable(allocationData)); EXPECT_FALSE(productHelper->overrideCacheableForDcFlushMitigation(allocationData.type)); break; } diff --git a/shared/test/unit_test/xe_hpg_core/mtl/product_helper_tests_mtl.cpp b/shared/test/unit_test/xe_hpg_core/mtl/product_helper_tests_mtl.cpp index 42b5787a0d..ac5acfbb04 100644 --- a/shared/test/unit_test/xe_hpg_core/mtl/product_helper_tests_mtl.cpp +++ b/shared/test/unit_test/xe_hpg_core/mtl/product_helper_tests_mtl.cpp @@ -72,11 +72,11 @@ MTLTEST_F(MtlProductHelper, givenMtlWithoutHwIpVersionInHwInfoWhenGettingIpVersi EXPECT_EQ(compilerProductHelper->getDefaultHwIpVersion(), compilerProductHelper->getHwIpVersion(hwInfo)); } -MTLTEST_F(MtlProductHelper, givenProductHelperWhenCheckOverrideAllocationCacheableThenTrueIsReturnedForCommandBuffer) { +MTLTEST_F(MtlProductHelper, givenProductHelperWhenCheckoverrideAllocationCpuCacheableThenTrueIsReturnedForCommandBuffer) { AllocationData allocationData{}; allocationData.type = AllocationType::commandBuffer; - EXPECT_TRUE(productHelper->overrideAllocationCacheable(allocationData)); + EXPECT_TRUE(productHelper->overrideAllocationCpuCacheable(allocationData)); allocationData.type = AllocationType::buffer; - EXPECT_FALSE(productHelper->overrideAllocationCacheable(allocationData)); + EXPECT_FALSE(productHelper->overrideAllocationCpuCacheable(allocationData)); }