Move semaphore to local memory on XE_HPG

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk
2022-06-24 12:33:41 +00:00
committed by Compute-Runtime-Automation
parent 61b2ee45cd
commit 94f3e54261
2 changed files with 30 additions and 0 deletions

View File

@@ -28,6 +28,12 @@ void HwHelperHw<Family>::setExtraAllocationData(AllocationData &allocationData,
allocationData.flags.requiresCpuAccess = false;
allocationData.storageInfo.isLockable = false;
}
} else if (hwInfo.featureTable.flags.ftrLocalMemory &&
(properties.allocationType == AllocationType::COMMAND_BUFFER ||
properties.allocationType == AllocationType::RING_BUFFER ||
properties.allocationType == AllocationType::SEMAPHORE_BUFFER)) {
allocationData.flags.useSystemMemory = false;
allocationData.flags.requiresCpuAccess = true;
}
if (hwInfoConfig.allowStatelessCompression(hwInfo)) {

View File

@@ -89,6 +89,30 @@ XE_HPG_CORETEST_F(LriHelperTestsXeHpgCore, whenProgrammingLriCommandThenExpectMm
EXPECT_TRUE(memcmp(lri, &expectedLri, sizeof(MI_LOAD_REGISTER_IMM)) == 0);
}
XE_HPG_CORETEST_F(HwHelperTestXeHpgCore, givenAllocDataWhenSetExtraAllocationDataThenSetLocalMemForProperTypes) {
auto &hwHelper = HwHelper::get(renderCoreFamily);
for (int type = 0; type < static_cast<int>(AllocationType::COUNT); type++) {
AllocationProperties allocProperties(0, 1, static_cast<AllocationType>(type), {});
AllocationData allocData{};
allocData.flags.useSystemMemory = true;
allocData.flags.requiresCpuAccess = false;
hwHelper.setExtraAllocationData(allocData, allocProperties, *defaultHwInfo);
if (defaultHwInfo->featureTable.flags.ftrLocalMemory &&
(allocProperties.allocationType == AllocationType::COMMAND_BUFFER ||
allocProperties.allocationType == AllocationType::RING_BUFFER ||
allocProperties.allocationType == AllocationType::SEMAPHORE_BUFFER)) {
EXPECT_FALSE(allocData.flags.useSystemMemory);
EXPECT_TRUE(allocData.flags.requiresCpuAccess);
} else {
EXPECT_TRUE(allocData.flags.useSystemMemory);
EXPECT_FALSE(allocData.flags.requiresCpuAccess);
}
}
}
XE_HPG_CORETEST_F(HwHelperTestXeHpgCore, GivenVariousValuesWhenAlignSlmSizeIsCalledThenCorrectValueIsReturned) {
EXPECT_EQ(0u, HwHelperHw<FamilyType>::get().alignSlmSize(0));
EXPECT_EQ(1024u, HwHelperHw<FamilyType>::get().alignSlmSize(1));