mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 05:24:02 +08:00
Add helper function to return proper mocs index basing on inputs.
Change-Id: I062891d02607fec932e0cb9ae84fe858e9d9e098 Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
6eb106875c
commit
918711c865
@@ -643,3 +643,24 @@ TEST_F(HwHelperTest, givenAUBDumpForceAllToLocalMemoryDebugVarWhenSetThenGetEnab
|
||||
DebugManager.flags.AUBDumpForceAllToLocalMemory.set(true);
|
||||
EXPECT_TRUE(helper.getEnableLocalMemory(hardwareInfo));
|
||||
}
|
||||
|
||||
TEST_F(HwHelperTest, givenVariousCachesRequestProperMOCSIndexesAreBeingReturned) {
|
||||
auto &helper = HwHelper::get(renderCoreFamily);
|
||||
auto gmmHelper = this->pDevice->getExecutionEnvironment()->getGmmHelper();
|
||||
auto expectedMocsForL3off = gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED) >> 1;
|
||||
auto expectedMocsForL3on = gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1;
|
||||
auto expectedMocsForL3andL1on = gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CONST) >> 1;
|
||||
|
||||
auto mocsIndex = helper.getMocsIndex(*gmmHelper, false, true);
|
||||
EXPECT_EQ(expectedMocsForL3off, mocsIndex);
|
||||
|
||||
mocsIndex = helper.getMocsIndex(*gmmHelper, true, false);
|
||||
EXPECT_EQ(expectedMocsForL3on, mocsIndex);
|
||||
|
||||
mocsIndex = helper.getMocsIndex(*gmmHelper, true, true);
|
||||
if (mocsIndex != expectedMocsForL3andL1on) {
|
||||
EXPECT_EQ(expectedMocsForL3on, mocsIndex);
|
||||
} else {
|
||||
EXPECT_EQ(expectedMocsForL3andL1on, mocsIndex);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user