diff --git a/opencl/test/unit_test/aub_tests/fixtures/aub_walker_partition_fixture.h b/opencl/test/unit_test/aub_tests/fixtures/aub_walker_partition_fixture.h index 63dd3233a7..90fa2b89ed 100644 --- a/opencl/test/unit_test/aub_tests/fixtures/aub_walker_partition_fixture.h +++ b/opencl/test/unit_test/aub_tests/fixtures/aub_walker_partition_fixture.h @@ -96,11 +96,7 @@ struct AubWalkerPartitionFixture : public KernelAUBFixture typename FamilyType::PIPE_CONTROL *retrieveSyncPipeControl(void *startAddress, const RootDeviceEnvironment &rootDeviceEnvironment) { using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; - - uint8_t buffer[256]; - LinearStream stream(buffer, 256); - MemorySynchronizationCommands::addBarrierWa(stream, 0ull, rootDeviceEnvironment, NEO::PostSyncMode::immediateData); - void *syncPipeControlAddress = reinterpret_cast(reinterpret_cast(startAddress) + stream.getUsed()); + void *syncPipeControlAddress = reinterpret_cast(reinterpret_cast(startAddress)); PIPE_CONTROL *pipeControl = genCmdCast(syncPipeControlAddress); return pipeControl; } diff --git a/opencl/test/unit_test/xe_hpc_core/gfx_core_helper_tests_xe_hpc_core.cpp b/opencl/test/unit_test/xe_hpc_core/gfx_core_helper_tests_xe_hpc_core.cpp index 301921a3c1..93735a5300 100644 --- a/opencl/test/unit_test/xe_hpc_core/gfx_core_helper_tests_xe_hpc_core.cpp +++ b/opencl/test/unit_test/xe_hpc_core/gfx_core_helper_tests_xe_hpc_core.cpp @@ -568,23 +568,6 @@ XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, whenNonBcsEngineIsVerifiedThenRet EXPECT_FALSE(EngineHelpers::isBcs(static_cast(aub_stream::ENGINE_BCS8 + 1))); } -XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, whenPipecontrolWaIsProgrammedThenFlushL1Cache) { - DebugManagerStateRestore restorer; - debugManager.flags.DisablePipeControlPrecedingPostSyncCommand.set(1); - using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; - uint32_t buffer[64] = {}; - LinearStream cmdStream(buffer, sizeof(buffer)); - uint64_t gpuAddress = 0x1234; - - MemorySynchronizationCommands::addBarrierWa(cmdStream, gpuAddress, this->pDevice->getRootDeviceEnvironment(), NEO::PostSyncMode::noWrite); - - auto pipeControl = genCmdCast(buffer); - ASSERT_NE(nullptr, pipeControl); - EXPECT_TRUE(pipeControl->getCommandStreamerStallEnable()); - EXPECT_TRUE(pipeControl->getHdcPipelineFlush()); - EXPECT_TRUE(pipeControl->getUnTypedDataPortCacheFlush()); -} - XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, givenGfxCoreHelperWhenAskedIfFenceAllocationRequiredThenReturnCorrectValue) { DebugManagerStateRestore dbgRestore; diff --git a/shared/source/helpers/gfx_core_helper.h b/shared/source/helpers/gfx_core_helper.h index 9e82f351ce..38f376b749 100644 --- a/shared/source/helpers/gfx_core_helper.h +++ b/shared/source/helpers/gfx_core_helper.h @@ -538,7 +538,6 @@ struct MemorySynchronizationCommands { static void setPostSyncExtraProperties(PipeControlArgs &args); - static void addBarrierWa(LinearStream &commandStream, uint64_t gpuAddress, const RootDeviceEnvironment &rootDeviceEnvironment, NEO::PostSyncMode postSyncMode); static void setBarrierWa(void *&commandsBuffer, uint64_t gpuAddress, const RootDeviceEnvironment &rootDeviceEnvironment, NEO::PostSyncMode postSyncMode); static void setBarrierWaFlags(void *barrierCmd); diff --git a/shared/source/helpers/gfx_core_helper_base.inl b/shared/source/helpers/gfx_core_helper_base.inl index 98751c9914..dcdfb3eb6c 100644 --- a/shared/source/helpers/gfx_core_helper_base.inl +++ b/shared/source/helpers/gfx_core_helper_base.inl @@ -323,13 +323,6 @@ void MemorySynchronizationCommands::setSingleBarrier(void *commandsBu *reinterpret_cast(commandsBuffer) = pipeControl; } -template -void MemorySynchronizationCommands::addBarrierWa(LinearStream &commandStream, uint64_t gpuAddress, const RootDeviceEnvironment &rootDeviceEnvironment, NEO::PostSyncMode postSyncMode) { - size_t requiredSize = MemorySynchronizationCommands::getSizeForBarrierWa(rootDeviceEnvironment, postSyncMode); - void *commandBuffer = commandStream.getSpace(requiredSize); - setBarrierWa(commandBuffer, gpuAddress, rootDeviceEnvironment, postSyncMode); -} - template void MemorySynchronizationCommands::setBarrierWa(void *&commandsBuffer, uint64_t gpuAddress, const RootDeviceEnvironment &rootDeviceEnvironment, NEO::PostSyncMode postSyncMode) { using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL; diff --git a/shared/source/xe3_core/gfx_core_helper_xe3_core.cpp b/shared/source/xe3_core/gfx_core_helper_xe3_core.cpp index a6c2ef02df..7e8d7f53e9 100644 --- a/shared/source/xe3_core/gfx_core_helper_xe3_core.cpp +++ b/shared/source/xe3_core/gfx_core_helper_xe3_core.cpp @@ -194,10 +194,6 @@ inline void MemorySynchronizationCommands::setBarrierExtraProperties(voi } } -template <> -void MemorySynchronizationCommands::addBarrierWa(LinearStream &commandStream, uint64_t gpuAddress, const RootDeviceEnvironment &rootDeviceEnvironment, NEO::PostSyncMode postSyncMode) { -} - template <> void MemorySynchronizationCommands::setBarrierWa(void *&commandsBuffer, uint64_t gpuAddress, const RootDeviceEnvironment &rootDeviceEnvironment, NEO::PostSyncMode postSyncMode) { } diff --git a/shared/test/unit_test/helpers/gfx_core_helper_tests_dg2_and_later.cpp b/shared/test/unit_test/helpers/gfx_core_helper_tests_dg2_and_later.cpp index 754dac301a..53feaa89c5 100644 --- a/shared/test/unit_test/helpers/gfx_core_helper_tests_dg2_and_later.cpp +++ b/shared/test/unit_test/helpers/gfx_core_helper_tests_dg2_and_later.cpp @@ -102,60 +102,6 @@ HWTEST2_F(GfxCoreHelperDg2AndLaterTest, givenGfxCoreHelperWhenCallCalculateMaxWo using PipeControlHelperTestsDg2AndLater = ::testing::Test; -HWTEST2_F(PipeControlHelperTestsDg2AndLater, WhenAddingPipeControlWAThenCorrectCommandsAreProgrammed, IsAtLeastXeCore) { - using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; - using MI_SEMAPHORE_WAIT = typename FamilyType::MI_SEMAPHORE_WAIT; - uint8_t buffer[128]; - uint64_t address = 0x1234567887654321; - MockExecutionEnvironment mockExecutionEnvironment{}; - auto &hardwareInfo = *mockExecutionEnvironment.rootDeviceEnvironments[0]->getMutableHardwareInfo(); - auto &rootDeviceEnvironment = *mockExecutionEnvironment.rootDeviceEnvironments[0]; - - bool requiresMemorySynchronization = (MemorySynchronizationCommands::getSizeForAdditionalSynchronization(NEO::FenceType::release, rootDeviceEnvironment) > 0) ? true : false; - - for (auto ftrLocalMemory : ::testing::Bool()) { - LinearStream stream(buffer, 128); - hardwareInfo.featureTable.flags.ftrLocalMemory = ftrLocalMemory; - - MemorySynchronizationCommands::addBarrierWa(stream, address, rootDeviceEnvironment, NEO::PostSyncMode::immediateData); - - if (MemorySynchronizationCommands::isBarrierWaRequired(rootDeviceEnvironment) == false) { - EXPECT_EQ(0u, stream.getUsed()); - continue; - } - - GenCmdList cmdList; - FamilyType::Parse::parseCommandBuffer(cmdList, stream.getCpuBase(), stream.getUsed()); - EXPECT_EQ(requiresMemorySynchronization ? 2u : 1u, cmdList.size()); - - PIPE_CONTROL expectedPipeControl = FamilyType::cmdInitPipeControl; - expectedPipeControl.setCommandStreamerStallEnable(true); - UnitTestHelper::setPipeControlHdcPipelineFlush(expectedPipeControl, true); - expectedPipeControl.setUnTypedDataPortCacheFlush(true); - auto it = cmdList.begin(); - auto pPipeControl = genCmdCast(*it); - ASSERT_NE(nullptr, pPipeControl); - EXPECT_TRUE(memcmp(&expectedPipeControl, pPipeControl, sizeof(PIPE_CONTROL)) == 0); - - if (requiresMemorySynchronization) { - if (UnitTestHelper::isAdditionalMiSemaphoreWaitRequired(rootDeviceEnvironment)) { - MI_SEMAPHORE_WAIT expectedMiSemaphoreWait; - EncodeSemaphore::programMiSemaphoreWait(&expectedMiSemaphoreWait, address, - EncodeSemaphore::invalidHardwareTag, - MI_SEMAPHORE_WAIT::COMPARE_OPERATION::COMPARE_OPERATION_SAD_NOT_EQUAL_SDD, - false, - true, - false, - false, - false); - auto pMiSemaphoreWait = genCmdCast(*(++it)); - ASSERT_NE(nullptr, pMiSemaphoreWait); - EXPECT_TRUE(memcmp(&expectedMiSemaphoreWait, pMiSemaphoreWait, sizeof(MI_SEMAPHORE_WAIT)) == 0); - } - } - } -} - HWTEST2_F(PipeControlHelperTestsDg2AndLater, WhenSettingExtraPipeControlPropertiesThenCorrectValuesAreSet, IsAtLeastXeCore) { PipeControlArgs args{}; MemorySynchronizationCommands::setPostSyncExtraProperties(args); diff --git a/shared/test/unit_test/xe2_hpg_core/gfx_core_helper_tests_xe2_hpg_core.cpp b/shared/test/unit_test/xe2_hpg_core/gfx_core_helper_tests_xe2_hpg_core.cpp index 3f9de88555..eec837b4a3 100644 --- a/shared/test/unit_test/xe2_hpg_core/gfx_core_helper_tests_xe2_hpg_core.cpp +++ b/shared/test/unit_test/xe2_hpg_core/gfx_core_helper_tests_xe2_hpg_core.cpp @@ -460,22 +460,6 @@ XE2_HPG_CORETEST_F(GfxCoreHelperTestsXe2HpgCore, whenNonBcsEngineIsVerifiedThenR EXPECT_FALSE(EngineHelpers::isBcs(static_cast(aub_stream::ENGINE_BCS8 + 1))); } -XE2_HPG_CORETEST_F(GfxCoreHelperTestsXe2HpgCore, whenPipecontrolWaIsProgrammedThenFlushL1Cache) { - DebugManagerStateRestore restorer; - debugManager.flags.DisablePipeControlPrecedingPostSyncCommand.set(1); - using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; - uint32_t buffer[64] = {}; - LinearStream cmdStream(buffer, sizeof(buffer)); - uint64_t gpuAddress = 0x1234; - - MemorySynchronizationCommands::addBarrierWa(cmdStream, gpuAddress, this->pDevice->getRootDeviceEnvironment(), NEO::PostSyncMode::noWrite); - - auto pipeControl = reinterpret_cast(buffer); - EXPECT_TRUE(pipeControl->getCommandStreamerStallEnable()); - EXPECT_TRUE(pipeControl->getDataportFlush()); - EXPECT_TRUE(pipeControl->getUnTypedDataPortCacheFlush()); -} - XE2_HPG_CORETEST_F(GfxCoreHelperTestsXe2HpgCore, givenGfxCoreHelperWhenAskedIfFenceAllocationRequiredThenReturnCorrectValue) { DebugManagerStateRestore dbgRestore; 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 930f0792a2..9a33b3b725 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 @@ -147,42 +147,6 @@ XE_HPG_CORETEST_F(GfxCoreHelperTestXeHpgCore, GivenVariousValuesWhenAlignSlmSize EXPECT_EQ(65536u, gfxCoreHelper.alignSlmSize(65536)); } -XE_HPG_CORETEST_F(GfxCoreHelperTestXeHpgCore, givenDisablePipeControlFlagIsEnabledWhenLocalMemoryIsEnabledThenReturnTrueAndProgramPipeControl) { - using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; - DebugManagerStateRestore restore; - debugManager.flags.DisablePipeControlPrecedingPostSyncCommand.set(1); - MockExecutionEnvironment mockExecutionEnvironment{}; - auto &hardwareInfo = *mockExecutionEnvironment.rootDeviceEnvironments[0]->getMutableHardwareInfo(); - auto &rootDeviceEnvironment = *mockExecutionEnvironment.rootDeviceEnvironments[0]; - - hardwareInfo.featureTable.flags.ftrLocalMemory = true; - EXPECT_TRUE(MemorySynchronizationCommands::isBarrierWaRequired(rootDeviceEnvironment)); - - constexpr size_t bufferSize = 128u; - uint8_t buffer[bufferSize]; - LinearStream cmdStream(buffer, bufferSize); - MemorySynchronizationCommands::addBarrierWa(cmdStream, 0x1000, rootDeviceEnvironment, NEO::PostSyncMode::noWrite); - EXPECT_EQ(sizeof(PIPE_CONTROL), cmdStream.getUsed()); -} - -XE_HPG_CORETEST_F(GfxCoreHelperTestXeHpgCore, givenDisablePipeControlFlagIsEnabledWhenLocalMemoryIsDisabledThenReturnFalseAndDoNotProgramPipeControl) { - DebugManagerStateRestore restore; - debugManager.flags.DisablePipeControlPrecedingPostSyncCommand.set(1); - - MockExecutionEnvironment mockExecutionEnvironment{}; - auto &hardwareInfo = *mockExecutionEnvironment.rootDeviceEnvironments[0]->getMutableHardwareInfo(); - auto &rootDeviceEnvironment = *mockExecutionEnvironment.rootDeviceEnvironments[0]; - - hardwareInfo.featureTable.flags.ftrLocalMemory = false; - EXPECT_FALSE(MemorySynchronizationCommands::isBarrierWaRequired(rootDeviceEnvironment)); - - constexpr size_t bufferSize = 128u; - uint8_t buffer[bufferSize]; - LinearStream cmdStream(buffer, bufferSize); - MemorySynchronizationCommands::addBarrierWa(cmdStream, 0x1000, rootDeviceEnvironment, NEO::PostSyncMode::noWrite); - EXPECT_EQ(0u, cmdStream.getUsed()); -} - XE_HPG_CORETEST_F(GfxCoreHelperTestXeHpgCore, givenXeHpgCoreWhenCheckingIfEngineTypeRemappingIsRequiredThenReturnTrue) { auto &gfxCoreHelper = getHelper(); EXPECT_FALSE(gfxCoreHelper.isEngineTypeRemappingToHwSpecificRequired());