performance: add debug key to control cpu cacheablitiy

Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
Michal Mrozek
2024-06-19 09:52:20 +00:00
committed by Compute-Runtime-Automation
parent f7888fac0d
commit 0e29ab8387
4 changed files with 22 additions and 0 deletions

View File

@@ -177,6 +177,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, OverrideImmediateCmdListSynchronousMode, -1, "Ov
DECLARE_DEBUG_VARIABLE(int32_t, EnableStatelessCompression, -1, "-1: default, 0: disable, 1: Enable E2EC in SBA for all stateless accesses")
DECLARE_DEBUG_VARIABLE(int32_t, EnableMultiTileCompression, -1, "-1: default, 0: disable, 1: enable, Enables compression in multi tile scenarios.")
DECLARE_DEBUG_VARIABLE(int32_t, OverrideGmmResourceUsageField, -1, "-1: default, >=0: gmm.resourceParams.Usage is set to this value")
DECLARE_DEBUG_VARIABLE(int32_t, OverrideGmmCacheableField, -1, "-1: default, >=0: gmm Flags.Info.Cacheable is set to this value")
DECLARE_DEBUG_VARIABLE(int32_t, OverrideBufferSuitableForRenderCompression, -1, "-1: default, 0: Disable, 1: Enable")
DECLARE_DEBUG_VARIABLE(int32_t, OverrideL1CacheControlInSurfaceState, -1, "-1: feature inactive, >=0 : following L1 cache control value will be programmed in render surface state (for regular buffers)")
DECLARE_DEBUG_VARIABLE(int32_t, OverrideL1CacheControlInSurfaceStateForScratchSpace, -1, "-1: feature inactive, >=0 : following L1 cache control value will be programmed in render surface state for scratch space")

View File

@@ -45,6 +45,11 @@ Gmm::Gmm(GmmHelper *gmmHelper, const void *alignedPtr, size_t alignedSize, size_
gmmRequirements.overriderPreferNoCpuAccess.doOverride(this->preferNoCpuAccess);
gmmRequirements.overriderCacheable.doOverride(cacheable);
if (NEO::debugManager.flags.OverrideGmmCacheableField.get() != -1) {
cacheable = !!NEO::debugManager.flags.OverrideGmmCacheableField.get();
}
resourceParams.Flags.Info.Cacheable = cacheable;
resourceParams.Flags.Gpu.Texture = 1;

View File

@@ -377,6 +377,7 @@ AllowUnrestrictedSize = 0
ForceDefaultThreadArbitrationPolicyIfNotSpecified = 0
DoNotFreeResources = 0
OverrideGmmResourceUsageField = -1
OverrideGmmCacheableField = -1
LogAllocationType = 0
LogAllocationStdout = 0
ProgramExtendedPipeControlPriorToNonPipelinedStateCommand = -1

View File

@@ -136,4 +136,19 @@ HWTEST_F(GmmTests, givenVariousResourceUsageTypeWhenCreateGmmThenFlagCacheableIs
}
}
HWTEST_F(GmmTests, givenVariousCacheableDebugSettingsTheCacheableFieldIsProgrammedCorrectly) {
DebugManagerStateRestore restore;
debugManager.flags.OverrideGmmCacheableField.set(0);
StorageInfo storageInfo{};
GmmRequirements gmmRequirements{};
auto gmm = std::make_unique<Gmm>(getGmmHelper(), nullptr, 0, 0, GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER, storageInfo, gmmRequirements);
EXPECT_FALSE(gmm->resourceParams.Flags.Info.Cacheable);
debugManager.flags.OverrideGmmCacheableField.set(1);
auto gmm2 = std::make_unique<Gmm>(getGmmHelper(), nullptr, 0, 0, GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER, storageInfo, gmmRequirements);
EXPECT_TRUE(gmm2->resourceParams.Flags.Info.Cacheable);
}
} // namespace NEO