mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 21:18:24 +08:00
performance: add debug key to control cpu cacheablitiy
Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
f7888fac0d
commit
0e29ab8387
@@ -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")
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -377,6 +377,7 @@ AllowUnrestrictedSize = 0
|
||||
ForceDefaultThreadArbitrationPolicyIfNotSpecified = 0
|
||||
DoNotFreeResources = 0
|
||||
OverrideGmmResourceUsageField = -1
|
||||
OverrideGmmCacheableField = -1
|
||||
LogAllocationType = 0
|
||||
LogAllocationStdout = 0
|
||||
ProgramExtendedPipeControlPriorToNonPipelinedStateCommand = -1
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user