diff --git a/opencl/source/mem_obj/buffer.cpp b/opencl/source/mem_obj/buffer.cpp index d141c56597..8d1dc87c9a 100644 --- a/opencl/source/mem_obj/buffer.cpp +++ b/opencl/source/mem_obj/buffer.cpp @@ -744,6 +744,10 @@ size_t Buffer::calculateHostPtrSize(const size_t *origin, const size_t *region, } bool Buffer::isReadWriteOnCpuAllowed(const Device &device) { + if (!allowCpuAccess()) { + return false; + } + if (forceDisallowCPUCopy) { return false; } diff --git a/opencl/source/mem_obj/mem_obj.cpp b/opencl/source/mem_obj/mem_obj.cpp index d8ad8950fd..88eebc591e 100644 --- a/opencl/source/mem_obj/mem_obj.cpp +++ b/opencl/source/mem_obj/mem_obj.cpp @@ -430,7 +430,17 @@ bool MemObj::isTiledAllocation() const { bool MemObj::mappingOnCpuAllowed() const { auto graphicsAllocation = multiGraphicsAllocation.getDefaultGraphicsAllocation(); return !isTiledAllocation() && !peekSharingHandler() && !isMipMapped(this) && !DebugManager.flags.DisableZeroCopyForBuffers.get() && - !graphicsAllocation->isCompressionEnabled() && MemoryPoolHelper::isSystemMemoryPool(graphicsAllocation->getMemoryPool()); + !graphicsAllocation->isCompressionEnabled() && MemoryPoolHelper::isSystemMemoryPool(graphicsAllocation->getMemoryPool()) && + allowCpuAccess(); +} + +bool MemObj::allowCpuAccess() const { + auto graphicsAllocation = this->multiGraphicsAllocation.getDefaultGraphicsAllocation(); + if (graphicsAllocation->getDefaultGmm() == nullptr) { + return true; + } + + return !graphicsAllocation->getDefaultGmm()->getPreferNoCpuAccess(); } void MemObj::storeProperties(const cl_mem_properties *properties) { diff --git a/opencl/source/mem_obj/mem_obj.h b/opencl/source/mem_obj/mem_obj.h index 77ef741b60..d52c10b752 100644 --- a/opencl/source/mem_obj/mem_obj.h +++ b/opencl/source/mem_obj/mem_obj.h @@ -131,6 +131,7 @@ class MemObj : public BaseObject<_cl_mem> { void destroyGraphicsAllocation(GraphicsAllocation *allocation, bool asyncDestroy); bool checkIfMemoryTransferIsRequired(size_t offsetInMemObject, size_t offsetInHostPtr, const void *ptr, cl_command_type cmdType); bool mappingOnCpuAllowed() const; + MOCKABLE_VIRTUAL bool allowCpuAccess() const; virtual size_t calculateOffsetForMapping(const MemObjOffsetArray &offset) const { return offset[0]; } size_t calculateMappedPtrLength(const MemObjSizeArray &size) const { return calculateOffsetForMapping(size); } cl_mem_object_type peekClMemObjType() const { return memObjectType; } diff --git a/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp b/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp index 626b00ac3b..5c975027b0 100644 --- a/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp +++ b/opencl/test/unit_test/gmm_helper/gmm_helper_tests.cpp @@ -885,6 +885,14 @@ TEST(GmmTest, givenAllocationTypeWhenGettingUsageTypeThenReturnCorrectValue) { expectedUsage = (forceUncached || productHelper.isDcFlushAllowed()) ? GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED : GMM_RESOURCE_USAGE_OCL_BUFFER; break; + case AllocationType::BUFFER_HOST_MEMORY: + case AllocationType::INTERNAL_HOST_MEMORY: + case AllocationType::MAP_ALLOCATION: + case AllocationType::FILL_PATTERN: + case AllocationType::SVM_CPU: + case AllocationType::SVM_ZERO_COPY: + expectedUsage = forceUncached ? GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED : GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; + break; default: expectedUsage = forceUncached ? GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED : GMM_RESOURCE_USAGE_OCL_BUFFER; break; diff --git a/opencl/test/unit_test/mem_obj/buffer_tests.cpp b/opencl/test/unit_test/mem_obj/buffer_tests.cpp index 1b4238a7ca..4282ec59bb 100644 --- a/opencl/test/unit_test/mem_obj/buffer_tests.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_tests.cpp @@ -85,6 +85,19 @@ TEST(Buffer, whenBufferAllocatedInLocalMemoryThenCpuCopyIsDisallowed) { EXPECT_TRUE(buffer.isReadWriteOnCpuAllowed(device)); } +TEST(Buffer, givenNoCpuAccessWhenIsReadWriteOnCpuAllowedIsCalledThenReturnFalse) { + MockGraphicsAllocation allocation{}; + MockBuffer buffer(allocation); + UltDeviceFactory factory{1, 0}; + auto &device = *factory.rootDevices[0]; + + allocation.memoryPool = MemoryPool::System4KBPages; + EXPECT_TRUE(buffer.isReadWriteOnCpuAllowed(device)); + + buffer.allowCpuAccessReturnValue = false; + EXPECT_FALSE(buffer.isReadWriteOnCpuAllowed(device)); +} + TEST(Buffer, givenReadOnlySetOfInputFlagsWhenPassedToisReadOnlyMemoryPermittedByFlagsThenTrueIsReturned) { class MockBuffer : public Buffer { public: diff --git a/opencl/test/unit_test/mem_obj/mem_obj_tests.cpp b/opencl/test/unit_test/mem_obj/mem_obj_tests.cpp index 25f3dfdb00..cc7ccd10e5 100644 --- a/opencl/test/unit_test/mem_obj/mem_obj_tests.cpp +++ b/opencl/test/unit_test/mem_obj/mem_obj_tests.cpp @@ -342,6 +342,27 @@ TEST(MemObj, givenDefaultWhenAskedForCpuMappingThenReturnTrue) { EXPECT_TRUE(memObj.mappingOnCpuAllowed()); } +struct MyMockGmm : Gmm { + using Gmm::Gmm; + using Gmm::preferNoCpuAccess; +}; +TEST(MemObj, givenCpuAccessNotAllowedWhenAskedForCpuMappingThenReturnFalse) { + MockContext context; + MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment()); + + context.memoryManager = &memoryManager; + + auto allocation = memoryManager.allocateGraphicsMemoryWithProperties(MockAllocationProperties{context.getDevice(0)->getRootDeviceIndex(), MemoryConstants::pageSize}); + auto memoryProperties = ClMemoryPropertiesHelper::createMemoryProperties(CL_MEM_COPY_HOST_PTR, 0, 0, &context.getDevice(0)->getDevice()); + MemObj memObj(&context, CL_MEM_OBJECT_BUFFER, memoryProperties, CL_MEM_COPY_HOST_PTR, 0, + 64, allocation->getUnderlyingBuffer(), nullptr, GraphicsAllocationHelper::toMultiGraphicsAllocation(allocation), true, false, false); + allocation->setDefaultGmm(new MyMockGmm(context.getDevice(0)->getGmmHelper(), nullptr, 1, 0, GMM_RESOURCE_USAGE_OCL_BUFFER, false, {}, true)); + EXPECT_TRUE(memObj.mappingOnCpuAllowed()); + + static_cast(memObj.getGraphicsAllocation(0)->getDefaultGmm())->preferNoCpuAccess = true; + EXPECT_FALSE(memObj.mappingOnCpuAllowed()); +} + TEST(MemObj, givenNonCpuAccessibleMemoryWhenAskingForMappingOnCpuThenDisallow) { MockContext context; MockMemoryManager memoryManager(*context.getDevice(0)->getExecutionEnvironment()); diff --git a/opencl/test/unit_test/mocks/mock_buffer.h b/opencl/test/unit_test/mocks/mock_buffer.h index 1c2e601c8b..29816b94e0 100644 --- a/opencl/test/unit_test/mocks/mock_buffer.h +++ b/opencl/test/unit_test/mocks/mock_buffer.h @@ -10,6 +10,8 @@ #include "opencl/source/mem_obj/buffer.h" +#include + namespace NEO { class MockDevice; } @@ -62,6 +64,13 @@ class MockBuffer : public MockBufferStorage, public Buffer { } } + bool allowCpuAccess() const override { + if (allowCpuAccessReturnValue.has_value()) { + return *allowCpuAccessReturnValue; + } + return Buffer::allowCpuAccess(); + } + void setArgStateful(void *memory, bool forceNonAuxMode, bool disableL3, bool alignSizeForAuxTranslation, bool isReadOnly, const Device &device, bool useGlobalAtomics, bool areMultipleSubDevicesInContext) override; void transferDataToHostPtr(MemObjSizeArray ©Size, MemObjOffsetArray ©Offset) override { @@ -87,6 +96,8 @@ class MockBuffer : public MockBufferStorage, public Buffer { int transferDataToHostPtrCalledCount{0}; int transferDataFromHostPtrCalledCount{0}; + + std::optional allowCpuAccessReturnValue{}; }; class AlignedBuffer : public MockBufferStorage, public Buffer { diff --git a/shared/source/gmm_helper/cache_settings_helper.cpp b/shared/source/gmm_helper/cache_settings_helper.cpp index a4a265beed..2bfe609634 100644 --- a/shared/source/gmm_helper/cache_settings_helper.cpp +++ b/shared/source/gmm_helper/cache_settings_helper.cpp @@ -29,12 +29,17 @@ GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getGmmUsageType(AllocationType } } -bool CacheSettingsHelper::isResourceCacheableOnCpu(GMM_RESOURCE_USAGE_TYPE_ENUM gmmResourceUsageType, const ProductHelper &productHelper, bool isWsl) { - bool isCachingOnCpuAvailable = isWsl ? true : productHelper.isCachingOnCpuAvailable(); +bool CacheSettingsHelper::preferNoCpuAccess(GMM_RESOURCE_USAGE_TYPE_ENUM gmmResourceUsageType, const ProductHelper &productHelper, bool isWsl) { if (DebugManager.flags.EnableCpuCacheForResources.get()) { - isCachingOnCpuAvailable = true; + return false; } - return isCachingOnCpuAvailable && !CacheSettingsHelper::isUncachedType(gmmResourceUsageType); + if (isWsl) { + return false; + } + if (productHelper.isCachingOnCpuAvailable()) { + return false; + } + return (gmmResourceUsageType != GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER); } GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getDefaultUsageTypeWithCachingEnabled(AllocationType allocationType, const ProductHelper &productHelper) { @@ -54,20 +59,24 @@ GMM_RESOURCE_USAGE_TYPE_ENUM CacheSettingsHelper::getDefaultUsageTypeWithCaching } return GMM_RESOURCE_USAGE_OCL_BUFFER_CONST; case AllocationType::BUFFER: - case AllocationType::BUFFER_HOST_MEMORY: - case AllocationType::EXTERNAL_HOST_PTR: - case AllocationType::FILL_PATTERN: - case AllocationType::INTERNAL_HOST_MEMORY: - case AllocationType::MAP_ALLOCATION: case AllocationType::SHARED_BUFFER: - case AllocationType::SVM_CPU: case AllocationType::SVM_GPU: - case AllocationType::SVM_ZERO_COPY: case AllocationType::UNIFIED_SHARED_MEMORY: + case AllocationType::EXTERNAL_HOST_PTR: if (DebugManager.flags.DisableCachingForStatefulBufferAccess.get()) { return getDefaultUsageTypeWithCachingDisabled(allocationType); } return GMM_RESOURCE_USAGE_OCL_BUFFER; + case AllocationType::BUFFER_HOST_MEMORY: + case AllocationType::INTERNAL_HOST_MEMORY: + case AllocationType::MAP_ALLOCATION: + case AllocationType::FILL_PATTERN: + case AllocationType::SVM_CPU: + case AllocationType::SVM_ZERO_COPY: + if (DebugManager.flags.DisableCachingForStatefulBufferAccess.get()) { + return getDefaultUsageTypeWithCachingDisabled(allocationType); + } + return GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; case AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER: case AllocationType::TIMESTAMP_PACKET_TAG_BUFFER: if (productHelper.isDcFlushAllowed()) { diff --git a/shared/source/gmm_helper/cache_settings_helper.h b/shared/source/gmm_helper/cache_settings_helper.h index 1d32e47c2c..28b9090f1d 100644 --- a/shared/source/gmm_helper/cache_settings_helper.h +++ b/shared/source/gmm_helper/cache_settings_helper.h @@ -26,7 +26,7 @@ struct CacheSettingsHelper { (gmmResourceUsageType == GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED)); } - static bool isResourceCacheableOnCpu(GMM_RESOURCE_USAGE_TYPE_ENUM gmmResourceUsageType, const ProductHelper &productHelper, bool isWsl); + static bool preferNoCpuAccess(GMM_RESOURCE_USAGE_TYPE_ENUM gmmResourceUsageType, const ProductHelper &productHelper, bool isWsl); protected: static GMM_RESOURCE_USAGE_TYPE_ENUM getDefaultUsageTypeWithCachingEnabled(AllocationType allocationType, const ProductHelper &productHelper); diff --git a/shared/source/gmm_helper/gmm.cpp b/shared/source/gmm_helper/gmm.cpp index 189274b8ee..15b6300585 100644 --- a/shared/source/gmm_helper/gmm.cpp +++ b/shared/source/gmm_helper/gmm.cpp @@ -40,7 +40,8 @@ Gmm::Gmm(GmmHelper *gmmHelper, const void *alignedPtr, size_t alignedSize, size_ resourceParams.Usage = gmmResourceUsage; resourceParams.Flags.Info.Linear = 1; auto &productHelper = gmmHelper->getRootDeviceEnvironment().getHelper(); - resourceParams.Flags.Info.Cacheable = CacheSettingsHelper::isResourceCacheableOnCpu(gmmResourceUsage, productHelper, gmmHelper->getRootDeviceEnvironment().isWddmOnLinux()); + this->preferNoCpuAccess = CacheSettingsHelper::preferNoCpuAccess(gmmResourceUsage, productHelper, gmmHelper->getRootDeviceEnvironment().isWddmOnLinux()); + resourceParams.Flags.Info.Cacheable = !this->preferNoCpuAccess && !CacheSettingsHelper::isUncachedType(gmmResourceUsage); resourceParams.Flags.Gpu.Texture = 1; if (alignedPtr) { diff --git a/shared/source/gmm_helper/gmm.h b/shared/source/gmm_helper/gmm.h index fb998649a8..96adb6da70 100644 --- a/shared/source/gmm_helper/gmm.h +++ b/shared/source/gmm_helper/gmm.h @@ -47,6 +47,7 @@ class Gmm { uint32_t getUnifiedAuxPitchTiles(); uint32_t getAuxQPitch(); + bool getPreferNoCpuAccess() const { return preferNoCpuAccess; } GMM_RESCREATE_PARAMS resourceParams = {}; std::unique_ptr gmmResourceInfo; @@ -60,5 +61,7 @@ class Gmm { void applyExtraMemoryFlags(const StorageInfo &storageInfo); void applyDebugOverrides(); GmmHelper *gmmHelper = nullptr; + + bool preferNoCpuAccess = false; }; } // namespace NEO diff --git a/shared/test/unit_test/gmm_helper/gmm_tests.cpp b/shared/test/unit_test/gmm_helper/gmm_tests.cpp index 55c2d30d2e..9788eecce3 100644 --- a/shared/test/unit_test/gmm_helper/gmm_tests.cpp +++ b/shared/test/unit_test/gmm_helper/gmm_tests.cpp @@ -16,20 +16,22 @@ namespace NEO { using GmmTests = Test; -TEST_F(GmmTests, givenResourceUsageTypesCacheableWhenCreateGmmAndFlagEnableCpuCacheForResourcesSetThenFlagCachcableIsTrue) { +TEST_F(GmmTests, givenResourceUsageTypesCacheableWhenCreateGmmAndFlagEnableCpuCacheForResourcesSetThenFlagCacheableIsTrue) { DebugManagerStateRestore restore; DebugManager.flags.EnableCpuCacheForResources.set(1); StorageInfo storageInfo{}; + auto &productHelper = getGmmHelper()->getRootDeviceEnvironment().getHelper(); for (auto resourceUsageType : {GMM_RESOURCE_USAGE_OCL_IMAGE, GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER, GMM_RESOURCE_USAGE_OCL_BUFFER_CONST, GMM_RESOURCE_USAGE_OCL_BUFFER}) { auto gmm = std::make_unique(getGmmHelper(), nullptr, 0, 0, resourceUsageType, false, storageInfo, false); + EXPECT_FALSE(CacheSettingsHelper::preferNoCpuAccess(resourceUsageType, productHelper, false)); EXPECT_TRUE(gmm->resourceParams.Flags.Info.Cacheable); } } -TEST_F(GmmTests, givenResourceUsageTypesCacheableWhenCreateGmmAndFlagEnableCpuCacheForResourcesNotSetThenFlagCachcableIsRelatedToValueFromHelperIsCachingOnCpuAvailable) { +TEST_F(GmmTests, givenResourceUsageTypesCacheableWhenCreateGmmAndFlagEnableCpuCacheForResourcesNotSetThenFlagCacheableIsRelatedToValueFromHelperIsCachingOnCpuAvailable) { DebugManagerStateRestore restore; DebugManager.flags.EnableCpuCacheForResources.set(0); StorageInfo storageInfo{}; @@ -39,7 +41,8 @@ TEST_F(GmmTests, givenResourceUsageTypesCacheableWhenCreateGmmAndFlagEnableCpuCa GMM_RESOURCE_USAGE_OCL_BUFFER_CONST, GMM_RESOURCE_USAGE_OCL_BUFFER}) { auto gmm = std::make_unique(getGmmHelper(), nullptr, 0, 0, resourceUsageType, false, storageInfo, false); - EXPECT_EQ(productHelper.isCachingOnCpuAvailable(), gmm->resourceParams.Flags.Info.Cacheable); + EXPECT_EQ(productHelper.isCachingOnCpuAvailable(), !CacheSettingsHelper::preferNoCpuAccess(resourceUsageType, productHelper, false)); + EXPECT_EQ(productHelper.isCachingOnCpuAvailable(), !gmm->getPreferNoCpuAccess()); } } @@ -56,15 +59,46 @@ TEST_F(GmmTests, givenResourceUsageTypesUnCachedWhenGreateGmmThenFlagCachcableIs HWTEST_F(GmmTests, givenIsResourceCacheableOnCpuWhenWslFlagThenReturnProperValue) { DebugManagerStateRestore restore; DebugManager.flags.EnableCpuCacheForResources.set(false); + StorageInfo storageInfo{}; auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getProductHelper(); + bool isWsl = true; - GMM_RESOURCE_USAGE_TYPE_ENUM gmmResourceUsageType = GMM_RESOURCE_USAGE_OCL_BUFFER; - EXPECT_EQ(!CacheSettingsHelper::isUncachedType(gmmResourceUsageType), CacheSettingsHelper::isResourceCacheableOnCpu(gmmResourceUsageType, productHelper, true)); - EXPECT_EQ(productHelper.isCachingOnCpuAvailable(), CacheSettingsHelper::isResourceCacheableOnCpu(gmmResourceUsageType, productHelper, false)); + GMM_RESOURCE_USAGE_TYPE_ENUM gmmResourceUsageType = GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER; + auto gmm = std::make_unique(getGmmHelper(), nullptr, 0, 0, gmmResourceUsageType, false, storageInfo, false); + EXPECT_FALSE(CacheSettingsHelper::preferNoCpuAccess(gmmResourceUsageType, productHelper, isWsl)); + EXPECT_TRUE(gmm->resourceParams.Flags.Info.Cacheable); gmmResourceUsageType = GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED; - EXPECT_EQ(!CacheSettingsHelper::isUncachedType(gmmResourceUsageType), CacheSettingsHelper::isResourceCacheableOnCpu(gmmResourceUsageType, productHelper, true)); - EXPECT_EQ(productHelper.isCachingOnCpuAvailable() && !CacheSettingsHelper::isUncachedType(gmmResourceUsageType), - CacheSettingsHelper::isResourceCacheableOnCpu(gmmResourceUsageType, productHelper, false)); + gmm = std::make_unique(getGmmHelper(), nullptr, 0, 0, gmmResourceUsageType, false, storageInfo, false); + EXPECT_FALSE(CacheSettingsHelper::preferNoCpuAccess(gmmResourceUsageType, productHelper, isWsl)); + EXPECT_FALSE(gmm->resourceParams.Flags.Info.Cacheable); } + +HWTEST_F(GmmTests, givenVariousResourceUsageTypeWhenCreateGmmThenFlagCacheableIsSetProperly) { + DebugManagerStateRestore restore; + DebugManager.flags.EnableCpuCacheForResources.set(false); + StorageInfo storageInfo{}; + auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getProductHelper(); + + for (auto regularResourceUsageType : {GMM_RESOURCE_USAGE_OCL_IMAGE, + GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER, + GMM_RESOURCE_USAGE_OCL_BUFFER_CONST, + GMM_RESOURCE_USAGE_OCL_BUFFER}) { + auto gmm = std::make_unique(getGmmHelper(), nullptr, 0, 0, regularResourceUsageType, false, storageInfo, false); + EXPECT_EQ(productHelper.isCachingOnCpuAvailable(), gmm->resourceParams.Flags.Info.Cacheable); + } + + for (auto cpuAccessibleResourceUsageType : {GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER}) { + auto gmm = std::make_unique(getGmmHelper(), nullptr, 0, 0, cpuAccessibleResourceUsageType, false, storageInfo, false); + EXPECT_TRUE(gmm->resourceParams.Flags.Info.Cacheable); + } + + for (auto uncacheableResourceUsageType : {GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC, + GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER_CACHELINE_MISALIGNED, + GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED}) { + auto gmm = std::make_unique(getGmmHelper(), nullptr, 0, 0, uncacheableResourceUsageType, false, storageInfo, false); + EXPECT_FALSE(gmm->resourceParams.Flags.Info.Cacheable); + } +} + } // namespace NEO diff --git a/shared/test/unit_test/xe_hpg_core/mtl/CMakeLists.txt b/shared/test/unit_test/xe_hpg_core/mtl/CMakeLists.txt index 2cbfd3e4af..cd0f01fc6a 100644 --- a/shared/test/unit_test/xe_hpg_core/mtl/CMakeLists.txt +++ b/shared/test/unit_test/xe_hpg_core/mtl/CMakeLists.txt @@ -16,7 +16,6 @@ if(TESTS_MTL) ${CMAKE_CURRENT_SOURCE_DIR}/excludes_xe_hpg_core_mtl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/hw_aot_config_tests_mtl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/gfx_core_helper_tests_mtl.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/gmm_tests_mtl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/product_helper_tests_mtl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/hw_info_tests_mtl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/product_config_helper_tests_mtl.cpp diff --git a/shared/test/unit_test/xe_hpg_core/mtl/gmm_tests_mtl.cpp b/shared/test/unit_test/xe_hpg_core/mtl/gmm_tests_mtl.cpp deleted file mode 100644 index 16dde5912a..0000000000 --- a/shared/test/unit_test/xe_hpg_core/mtl/gmm_tests_mtl.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2023 Intel Corporation - * - * SPDX-License-Identifier: MIT - * - */ - -#include "shared/source/gmm_helper/cache_settings_helper.h" -#include "shared/test/common/fixtures/mock_execution_environment_gmm_fixture.h" -#include "shared/test/common/mocks/mock_execution_environment.h" -#include "shared/test/common/test_macros/hw_test.h" - -namespace NEO { -using GmmCacheSettingTests = Test; -MTLTEST_F(GmmCacheSettingTests, givenDefaultFlagsWhenCreateGmmForMtlThenFlagCachcableIsSetProperly) { - auto &productHelper = executionEnvironment->rootDeviceEnvironments[0]->getProductHelper(); - for (auto resourceUsageType : {GMM_RESOURCE_USAGE_OCL_IMAGE, - GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER, - GMM_RESOURCE_USAGE_OCL_BUFFER_CONST, - GMM_RESOURCE_USAGE_OCL_BUFFER, - GMM_RESOURCE_USAGE_OCL_BUFFER_CSR_UC, - GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER_CACHELINE_MISALIGNED, - GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED}) { - EXPECT_EQ(!CacheSettingsHelper::isUncachedType(resourceUsageType), CacheSettingsHelper::isResourceCacheableOnCpu(resourceUsageType, productHelper, true)); - } -} -} // namespace NEO \ No newline at end of file