fix: account for default chunking flag for shared prefetch determination

This PR accounts for default value of EnableBOChunking recently set to -1.

Related-To: NEO-9120

Signed-off-by: John Falkowski <john.falkowski@intel.com>
This commit is contained in:
John Falkowski 2023-11-08 21:49:13 +00:00 committed by Compute-Runtime-Automation
parent 8a50cdf130
commit ff480efe7a
2 changed files with 33 additions and 1 deletions

View File

@ -72,6 +72,6 @@ const StackVec<DebugVarPrefix, 4> &ApiSpecificConfig::getPrefixTypes() {
bool ApiSpecificConfig::isSharedAllocPrefetchEnabled() {
return (NEO::DebugManager.flags.ForceMemoryPrefetchForKmdMigratedSharedAllocations.get() ||
(NEO::DebugManager.flags.EnableBOChunkingPrefetch.get() && ((NEO::DebugManager.flags.EnableBOChunking.get()) & 0x1)));
(NEO::DebugManager.flags.EnableBOChunkingPrefetch.get() && ((NEO::DebugManager.flags.EnableBOChunking.get()) != -1) && ((NEO::DebugManager.flags.EnableBOChunking.get()) & 0x1)));
}
} // namespace NEO

View File

@ -53,6 +53,38 @@ TEST(ApiSpecificConfigL0Tests, GivenDebugFlagSetWhenCheckingIfDynamicPostSyncAll
EXPECT_FALSE(ApiSpecificConfig::isDynamicPostSyncAllocLayoutEnabled());
}
TEST(ApiSpecificConfigL0Tests, GivenDebugFlagCombinationsGetCorrectSharedAllocPrefetchEnabled) {
DebugManagerStateRestore restore;
EXPECT_FALSE(ApiSpecificConfig::isSharedAllocPrefetchEnabled());
DebugManager.flags.ForceMemoryPrefetchForKmdMigratedSharedAllocations.set(true);
EXPECT_TRUE(ApiSpecificConfig::isSharedAllocPrefetchEnabled());
DebugManager.flags.ForceMemoryPrefetchForKmdMigratedSharedAllocations.set(false);
DebugManager.flags.EnableBOChunkingPrefetch.set(true);
EXPECT_FALSE(ApiSpecificConfig::isSharedAllocPrefetchEnabled());
DebugManager.flags.EnableBOChunking.set(1);
EXPECT_TRUE(ApiSpecificConfig::isSharedAllocPrefetchEnabled());
DebugManager.flags.EnableBOChunking.set(2);
EXPECT_FALSE(ApiSpecificConfig::isSharedAllocPrefetchEnabled());
DebugManager.flags.EnableBOChunking.set(3);
EXPECT_TRUE(ApiSpecificConfig::isSharedAllocPrefetchEnabled());
DebugManager.flags.EnableBOChunking.set(0);
EXPECT_FALSE(ApiSpecificConfig::isSharedAllocPrefetchEnabled());
}
TEST(ImplicitScalingApiTests, givenLevelZeroApiUsedThenSupportEnabled) {
EXPECT_TRUE(ImplicitScaling::apiSupport);
}