fix: Change default setting flag EnableCpuCacheForResources to true on mtl

Related-To: HSD-18030829682
Signed-off-by: Cencelewska, Katarzyna <katarzyna.cencelewska@intel.com>
This commit is contained in:
Cencelewska, Katarzyna 2023-06-19 10:07:38 +00:00 committed by Compute-Runtime-Automation
parent a28ce445ac
commit 9f7374da6e
4 changed files with 30 additions and 2 deletions

View File

@ -497,7 +497,7 @@ DECLARE_DEBUG_VARIABLE(bool, SkipFlushingEventsOnGetStatusCalls, false, "When se
DECLARE_DEBUG_VARIABLE(bool, AllowUnrestrictedSize, false, "Allow allocating memory with greater size than MAX_MEM_ALLOC_SIZE")
DECLARE_DEBUG_VARIABLE(bool, ForceDefaultThreadArbitrationPolicyIfNotSpecified, false, "When executing kernel without thread arbitration hint specified, ensure the default setting is used")
DECLARE_DEBUG_VARIABLE(bool, ForceAllResourcesUncached, false, "When set, all memory operations for all resources are forced to UC. This overrides all caching-related debug variables and globally disables all caches")
DECLARE_DEBUG_VARIABLE(bool, EnableCpuCacheForResources, false, "When true, driver will set gmm flag cacheable related to caching on cpu, for resources where it is allowed")
DECLARE_DEBUG_VARIABLE(bool, EnableCpuCacheForResources, true, "When true, driver will set gmm flag cacheable related to caching on cpu, for resources where it is allowed")
DECLARE_DEBUG_VARIABLE(bool, EnableDebuggerMmapMemoryAccess, false, "Mmap used to access memory by debug api, valid only on Linux OS")
DECLARE_DEBUG_VARIABLE(bool, ForceDefaultGrfCompilationMode, false, "Adds build option -cl-intel-128-GRF-per-thread to force kernel compilation in Default-GRF mode")
DECLARE_DEBUG_VARIABLE(bool, ForceLargeGrfCompilationMode, false, "Adds build option -cl-intel-256-GRF-per-thread to force kernel compilation in Large-GRF mode")

View File

@ -528,7 +528,7 @@ ExitOnSubmissionMode = 0
ForceInOrderImmediateCmdListExecution = -1
ForceTlbFlush = -1
DebugSetMemoryDiagnosticsDelay = -1
EnableCpuCacheForResources = 0
EnableCpuCacheForResources = 1
OverrideHwIpVersion = -1
PrintGlobalTimestampInNs = 0
EnableDeviceStateVerification = -1

View File

@ -15,6 +15,7 @@ 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

View File

@ -0,0 +1,27 @@
/*
* 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<MockExecutionEnvironmentGmmFixture>;
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