diff --git a/level_zero/core/source/xe_hpg_core/l0_gfx_core_helper_xe_hpg_core.cpp b/level_zero/core/source/xe_hpg_core/l0_gfx_core_helper_xe_hpg_core.cpp index b8472af6de..a12356a5b8 100644 --- a/level_zero/core/source/xe_hpg_core/l0_gfx_core_helper_xe_hpg_core.cpp +++ b/level_zero/core/source/xe_hpg_core/l0_gfx_core_helper_xe_hpg_core.cpp @@ -24,6 +24,11 @@ bool L0GfxCoreHelperHw::isResumeWARequired() { return true; } +template <> +bool L0GfxCoreHelperHw::alwaysAllocateEventInLocalMem() const { + return true; +} + template class L0GfxCoreHelperHw; } // namespace L0 diff --git a/level_zero/core/test/unit_tests/sources/helper/l0_gfx_core_helper_tests.cpp b/level_zero/core/test/unit_tests/sources/helper/l0_gfx_core_helper_tests.cpp index 6cc121f182..86f4389bab 100644 --- a/level_zero/core/test/unit_tests/sources/helper/l0_gfx_core_helper_tests.cpp +++ b/level_zero/core/test/unit_tests/sources/helper/l0_gfx_core_helper_tests.cpp @@ -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(); diff --git a/level_zero/core/test/unit_tests/xe_hpg_core/test_l0_gfx_core_helper_xe_hpg_core.cpp b/level_zero/core/test/unit_tests/xe_hpg_core/test_l0_gfx_core_helper_xe_hpg_core.cpp index 2d7ddfdd19..21f1e461c0 100644 --- a/level_zero/core/test/unit_tests/xe_hpg_core/test_l0_gfx_core_helper_xe_hpg_core.cpp +++ b/level_zero/core/test/unit_tests/xe_hpg_core/test_l0_gfx_core_helper_xe_hpg_core.cpp @@ -31,6 +31,11 @@ XE_HPG_CORETEST_F(L0GfxCoreHelperTestXeHpg, GivenXeHpgWhenCheckingL0HelperForMul EXPECT_FALSE(l0GfxCoreHelper.multiTileCapablePlatform()); } +XE_HPG_CORETEST_F(L0GfxCoreHelperTestXeHpg, GivenXeHpgPlatformsWhenAlwaysAllocateEventInLocalMemCalledThenReturnTrue) { + auto &l0GfxCoreHelper = getHelper(); + EXPECT_TRUE(l0GfxCoreHelper.alwaysAllocateEventInLocalMem()); +} + XE_HPG_CORETEST_F(L0GfxCoreHelperTestXeHpg, GivenXeHpgWhenCheckingL0HelperForCmdListHeapSharingSupportThenReturnTrue) { auto &l0GfxCoreHelper = getHelper(); EXPECT_TRUE(l0GfxCoreHelper.platformSupportsCmdListHeapSharing()); diff --git a/shared/source/helpers/extra_allocation_data_xehp_and_later.inl b/shared/source/helpers/extra_allocation_data_xehp_and_later.inl index c70cf0687a..9edc919c50 100644 --- a/shared/source/helpers/extra_allocation_data_xehp_and_later.inl +++ b/shared/source/helpers/extra_allocation_data_xehp_and_later.inl @@ -36,7 +36,8 @@ void GfxCoreHelperHw::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; } diff --git a/shared/test/unit_test/xe_hpg_core/gfx_core_helper_tests_xe_hpg_core.cpp b/shared/test/unit_test/xe_hpg_core/gfx_core_helper_tests_xe_hpg_core.cpp index 3febd89052..190d56d1ef 100644 --- a/shared/test/unit_test/xe_hpg_core/gfx_core_helper_tests_xe_hpg_core.cpp +++ b/shared/test/unit_test/xe_hpg_core/gfx_core_helper_tests_xe_hpg_core.cpp @@ -101,24 +101,32 @@ XE_HPG_CORETEST_F(LriHelperTestsXeHpgCore, whenProgrammingLriCommandThenExpectMm XE_HPG_CORETEST_F(GfxCoreHelperTestXeHpgCore, givenAllocDataWhenSetExtraAllocationDataThenSetLocalMemForProperTypes) { auto &gfxCoreHelper = getHelper(); + auto &productHelper = getHelper(); - for (int type = 0; type < static_cast(AllocationType::COUNT); type++) { - AllocationProperties allocProperties(0, 1, static_cast(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(AllocationType::COUNT); type++) { + AllocationProperties allocProperties(0, 1, static_cast(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); + } } } }