mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 21:42:53 +08:00
refactor: Add dc flush mitigation infrastructure
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
656788e6c1
commit
e4412e385a
@@ -312,9 +312,11 @@ HWTEST_F(ProductHelperTest, givenVariousValuesWhenGettingAubStreamSteppingFromHw
|
||||
|
||||
HWTEST_F(ProductHelperTest, givenDcFlushMitigationWhenOverridePatAndUsageForDcFlushMitigationThenReturnCorrectValue) {
|
||||
DebugManagerStateRestore restorer;
|
||||
for (auto i = 0; i < static_cast<int>(AllocationType::count); ++i) {
|
||||
auto allocationType = static_cast<AllocationType>(i);
|
||||
EXPECT_FALSE(productHelper->overridePatAndUsageForDcFlushMitigation(allocationType));
|
||||
if (!productHelper->isDcFlushMitigated()) {
|
||||
for (auto i = 0; i < static_cast<int>(AllocationType::count); ++i) {
|
||||
auto allocationType = static_cast<AllocationType>(i);
|
||||
EXPECT_FALSE(productHelper->overridePatAndUsageForDcFlushMitigation(allocationType));
|
||||
}
|
||||
}
|
||||
debugManager.flags.AllowDcFlush.set(0);
|
||||
for (auto i = 0; i < static_cast<int>(AllocationType::count); ++i) {
|
||||
|
||||
@@ -2899,7 +2899,11 @@ HWTEST_F(WddmMemoryManagerTest, givenInternalHeapOrLinearStreamTypeWhenAllocatin
|
||||
|
||||
ASSERT_NE(nullptr, allocation);
|
||||
|
||||
EXPECT_TRUE(allocation->getDefaultGmm()->resourceParams.Usage == GMM_RESOURCE_USAGE_TYPE::GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER);
|
||||
if (rootDeviceEnvironment->getProductHelper().isDcFlushMitigated()) {
|
||||
EXPECT_TRUE(allocation->getDefaultGmm()->resourceParams.Usage == GMM_RESOURCE_USAGE_TYPE::GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER_CACHELINE_MISALIGNED);
|
||||
} else {
|
||||
EXPECT_TRUE(allocation->getDefaultGmm()->resourceParams.Usage == GMM_RESOURCE_USAGE_TYPE::GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER);
|
||||
}
|
||||
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
}
|
||||
@@ -2911,7 +2915,11 @@ HWTEST_F(WddmMemoryManagerTest, givenInternalHeapOrLinearStreamTypeWhenAllocatin
|
||||
|
||||
ASSERT_NE(nullptr, allocation);
|
||||
|
||||
EXPECT_TRUE(allocation->getDefaultGmm()->resourceParams.Usage == GMM_RESOURCE_USAGE_TYPE::GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER);
|
||||
if (rootDeviceEnvironment->getProductHelper().isDcFlushMitigated()) {
|
||||
EXPECT_TRUE(allocation->getDefaultGmm()->resourceParams.Usage == GMM_RESOURCE_USAGE_TYPE::GMM_RESOURCE_USAGE_OCL_SYSTEM_MEMORY_BUFFER_CACHELINE_MISALIGNED);
|
||||
} else {
|
||||
EXPECT_TRUE(allocation->getDefaultGmm()->resourceParams.Usage == GMM_RESOURCE_USAGE_TYPE::GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER);
|
||||
}
|
||||
|
||||
memoryManager->freeGraphicsMemory(allocation);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user