performance: Optimize heap handling when mitigate dc flush

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2024-08-29 15:06:54 +00:00
committed by Compute-Runtime-Automation
parent dec502e11b
commit 1a8149e91c
10 changed files with 51 additions and 14 deletions

View File

@@ -292,7 +292,17 @@ bool ProductHelperHw<IGFX_UNKNOWN>::mitigateDcFlush() const {
}
template <>
bool ProductHelperHw<IGFX_UNKNOWN>::overridePatAndUsageForDcFlushMitigation(AllocationType allocationType) const {
bool ProductHelperHw<IGFX_UNKNOWN>::overridePatToUCAndCohForDcFlushMitigation(AllocationType allocationType) const {
return false;
}
template <>
bool ProductHelperHw<IGFX_UNKNOWN>::overrideUsageForDcFlushMitigation(AllocationType allocationType) const {
return false;
}
template <>
bool ProductHelperHw<IGFX_UNKNOWN>::overridePatToUCAndNonCohForDcFlushMitigation(AllocationType allocationType) const {
return false;
}

View File

@@ -310,12 +310,12 @@ HWTEST_F(ProductHelperTest, givenVariousValuesWhenGettingAubStreamSteppingFromHw
EXPECT_EQ(AubMemDump::SteppingValues::A, mockProductHelper.getAubStreamSteppingFromHwRevId(pInHwInfo));
}
HWTEST_F(ProductHelperTest, givenDcFlushMitigationWhenOverridePatAndUsageForDcFlushMitigationThenReturnCorrectValue) {
HWTEST_F(ProductHelperTest, givenDcFlushMitigationWhenOverridePatToUCAndCohForDcFlushMitigationThenReturnCorrectValue) {
DebugManagerStateRestore restorer;
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));
EXPECT_FALSE(productHelper->overridePatToUCAndCohForDcFlushMitigation(allocationType));
}
}
debugManager.flags.AllowDcFlush.set(0);
@@ -333,9 +333,9 @@ HWTEST_F(ProductHelperTest, givenDcFlushMitigationWhenOverridePatAndUsageForDcFl
allocationType == AllocationType::linearStream ||
allocationType == AllocationType::internalHeap ||
allocationType == AllocationType::printfSurface) {
EXPECT_EQ(productHelper->overridePatAndUsageForDcFlushMitigation(allocationType), productHelper->isDcFlushMitigated());
EXPECT_EQ(productHelper->overrideUsageForDcFlushMitigation(allocationType), productHelper->isDcFlushMitigated());
} else {
EXPECT_FALSE(productHelper->overridePatAndUsageForDcFlushMitigation(allocationType));
EXPECT_FALSE(productHelper->overridePatToUCAndCohForDcFlushMitigation(allocationType));
}
}
}

View File

@@ -146,8 +146,6 @@ LNLTEST_F(LnlProductHelper, givenExternalHostPtrWhenMitigateDcFlushThenOverrideC
allocationType == AllocationType::svmZeroCopy ||
allocationType == AllocationType::internalHostMemory ||
allocationType == AllocationType::commandBuffer ||
allocationType == AllocationType::internalHeap ||
allocationType == AllocationType::linearStream ||
allocationType == AllocationType::printfSurface) {
EXPECT_TRUE(productHelper->overrideAllocationCacheable(allocationData));
} else {

View File

@@ -40,6 +40,8 @@ LNLTEST_F(LnlProductHelperWindows, givenProductHelperWhenOverridePatIndexCalledT
EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::internalHostMemory));
EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::timestampPacketTagBuffer));
EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::tagBuffer));
EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::linearStream));
EXPECT_EQ(expectedPatIndex, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::internalHeap));
debugManager.flags.AllowDcFlush.set(0);
@@ -51,6 +53,10 @@ LNLTEST_F(LnlProductHelperWindows, givenProductHelperWhenOverridePatIndexCalledT
EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::internalHostMemory));
EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::timestampPacketTagBuffer));
EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::tagBuffer));
expectedPatIndexOverride = 0u;
EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::linearStream));
EXPECT_EQ(expectedPatIndexOverride, productHelper->overridePatIndex(0u, expectedPatIndex, AllocationType::internalHeap));
}
LNLTEST_F(LnlProductHelperWindows, givenProductHelperWhenIsStagingBuffersEnabledThenTrueIsReturned) {