compute events select device memory for xe hpg family

Related-To: NEO-7765

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz 2023-03-02 12:25:00 +00:00 committed by Compute-Runtime-Automation
parent 802848a43f
commit 072233d170
5 changed files with 36 additions and 17 deletions

View File

@ -24,6 +24,11 @@ bool L0GfxCoreHelperHw<Family>::isResumeWARequired() {
return true;
}
template <>
bool L0GfxCoreHelperHw<Family>::alwaysAllocateEventInLocalMem() const {
return true;
}
template class L0GfxCoreHelperHw<Family>;
} // namespace L0

View File

@ -686,7 +686,7 @@ HWTEST2_F(L0GfxCoreHelperTest, GivenNonMultiTilePlatformsWhenCheckingL0HelperFor
EXPECT_FALSE(l0GfxCoreHelper.multiTileCapablePlatform());
}
HWTEST2_F(L0GfxCoreHelperTest, whenAlwaysAllocateEventInLocalMemCalledThenReturnFalse, IsNotXeHpcCore) {
HWTEST2_F(L0GfxCoreHelperTest, whenAlwaysAllocateEventInLocalMemCalledThenReturnFalse, IsNotXeHpgOrXeHpcCore) {
MockExecutionEnvironment executionEnvironment;
auto &l0GfxCoreHelper = executionEnvironment.rootDeviceEnvironments[0]->getHelper<L0GfxCoreHelper>();

View File

@ -31,6 +31,11 @@ XE_HPG_CORETEST_F(L0GfxCoreHelperTestXeHpg, GivenXeHpgWhenCheckingL0HelperForMul
EXPECT_FALSE(l0GfxCoreHelper.multiTileCapablePlatform());
}
XE_HPG_CORETEST_F(L0GfxCoreHelperTestXeHpg, GivenXeHpgPlatformsWhenAlwaysAllocateEventInLocalMemCalledThenReturnTrue) {
auto &l0GfxCoreHelper = getHelper<L0GfxCoreHelper>();
EXPECT_TRUE(l0GfxCoreHelper.alwaysAllocateEventInLocalMem());
}
XE_HPG_CORETEST_F(L0GfxCoreHelperTestXeHpg, GivenXeHpgWhenCheckingL0HelperForCmdListHeapSharingSupportThenReturnTrue) {
auto &l0GfxCoreHelper = getHelper<L0GfxCoreHelper>();
EXPECT_TRUE(l0GfxCoreHelper.platformSupportsCmdListHeapSharing());

View File

@ -36,7 +36,8 @@ void GfxCoreHelperHw<Family>::setExtraAllocationData(AllocationData &allocationD
} else if (hwInfo.featureTable.flags.ftrLocalMemory &&
(properties.allocationType == AllocationType::COMMAND_BUFFER ||
properties.allocationType == AllocationType::RING_BUFFER ||
properties.allocationType == AllocationType::SEMAPHORE_BUFFER)) {
properties.allocationType == AllocationType::SEMAPHORE_BUFFER ||
properties.allocationType == AllocationType::TIMESTAMP_PACKET_TAG_BUFFER)) {
allocationData.flags.useSystemMemory = false;
allocationData.flags.requiresCpuAccess = true;
}

View File

@ -101,24 +101,32 @@ XE_HPG_CORETEST_F(LriHelperTestsXeHpgCore, whenProgrammingLriCommandThenExpectMm
XE_HPG_CORETEST_F(GfxCoreHelperTestXeHpgCore, givenAllocDataWhenSetExtraAllocationDataThenSetLocalMemForProperTypes) {
auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
auto &productHelper = getHelper<ProductHelper>();
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;
auto hwInfo = pDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
hwInfo->platform.usRevId = productHelper.getHwRevIdFromStepping(REVISION_B, *hwInfo);
gfxCoreHelper.setExtraAllocationData(allocData, allocProperties, pDevice->getRootDeviceEnvironment());
for (int boolState = 0; boolState < 2; boolState++) {
hwInfo->featureTable.flags.ftrLocalMemory = !!boolState;
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;
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);
gfxCoreHelper.setExtraAllocationData(allocData, allocProperties, pDevice->getRootDeviceEnvironment());
if (hwInfo->featureTable.flags.ftrLocalMemory &&
(allocProperties.allocationType == AllocationType::COMMAND_BUFFER ||
allocProperties.allocationType == AllocationType::RING_BUFFER ||
allocProperties.allocationType == AllocationType::SEMAPHORE_BUFFER ||
allocProperties.allocationType == AllocationType::TIMESTAMP_PACKET_TAG_BUFFER)) {
EXPECT_FALSE(allocData.flags.useSystemMemory);
EXPECT_TRUE(allocData.flags.requiresCpuAccess);
} else {
EXPECT_TRUE(allocData.flags.useSystemMemory);
EXPECT_FALSE(allocData.flags.requiresCpuAccess);
}
}
}
}