Debug mask support to force uncached Gmm usage type

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2022-05-18 11:22:39 +00:00
committed by Compute-Runtime-Automation
parent 5f38555af5
commit 56a164ffcd
4 changed files with 27 additions and 1 deletions

View File

@@ -939,6 +939,24 @@ TEST(GmmTest, givenConstSurfaceWhenDebugFlagIsSetThenReturnUncachedType) {
CacheSettingsHelper::getGmmUsageType(AllocationType::CONSTANT_SURFACE, false, *defaultHwInfo));
}
TEST(GmmTest, givenUncachedDebugFlagMaskSetWhenAskingForUsageTypeThenReturnUncached) {
DebugManagerStateRestore restore;
constexpr int64_t bufferMask = 1 << (static_cast<int64_t>(AllocationType::BUFFER) - 1);
constexpr int64_t imageMask = 1 << (static_cast<int64_t>(AllocationType::IMAGE) - 1);
DebugManager.flags.ForceUncachedGmmUsageType.set(bufferMask | imageMask);
EXPECT_EQ(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED,
CacheSettingsHelper::getGmmUsageType(AllocationType::BUFFER, false, *defaultHwInfo));
EXPECT_EQ(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED,
CacheSettingsHelper::getGmmUsageType(AllocationType::IMAGE, false, *defaultHwInfo));
EXPECT_NE(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED,
CacheSettingsHelper::getGmmUsageType(AllocationType::BUFFER_HOST_MEMORY, false, *defaultHwInfo));
}
TEST(GmmTest, givenAllocationForStatefulAccessWhenDebugFlagIsSetThenReturnUncachedType) {
DebugManagerStateRestore restore;
DebugManager.flags.DisableCachingForStatefulBufferAccess.set(true);

View File

@@ -422,4 +422,5 @@ DirectSubmissionInsertSfenceInstructionPriorToSubmission = -1
EnableTimestampWaitForEvents = -1
ForceWddmLowPriorityContextValue = -1
EnableDebuggerMmapMemoryAccess = 0
FailBuildProgramWithStatefulAccess = -1
FailBuildProgramWithStatefulAccess = -1
ForceUncachedGmmUsageType = 0