refactor: remove unused code

Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
Szymon Morek
2025-10-14 12:43:17 +00:00
committed by Compute-Runtime-Automation
parent 23784833ff
commit bb0f62896f
8 changed files with 1 additions and 140 deletions

View File

@@ -96,11 +96,7 @@ struct AubWalkerPartitionFixture : public KernelAUBFixture<SimpleKernelFixture>
typename FamilyType::PIPE_CONTROL *retrieveSyncPipeControl(void *startAddress, typename FamilyType::PIPE_CONTROL *retrieveSyncPipeControl(void *startAddress,
const RootDeviceEnvironment &rootDeviceEnvironment) { const RootDeviceEnvironment &rootDeviceEnvironment) {
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL; using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
void *syncPipeControlAddress = reinterpret_cast<void *>(reinterpret_cast<size_t>(startAddress));
uint8_t buffer[256];
LinearStream stream(buffer, 256);
MemorySynchronizationCommands<FamilyType>::addBarrierWa(stream, 0ull, rootDeviceEnvironment, NEO::PostSyncMode::immediateData);
void *syncPipeControlAddress = reinterpret_cast<void *>(reinterpret_cast<size_t>(startAddress) + stream.getUsed());
PIPE_CONTROL *pipeControl = genCmdCast<PIPE_CONTROL *>(syncPipeControlAddress); PIPE_CONTROL *pipeControl = genCmdCast<PIPE_CONTROL *>(syncPipeControlAddress);
return pipeControl; return pipeControl;
} }

View File

@@ -568,23 +568,6 @@ XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, whenNonBcsEngineIsVerifiedThenRet
EXPECT_FALSE(EngineHelpers::isBcs(static_cast<aub_stream::EngineType>(aub_stream::ENGINE_BCS8 + 1))); EXPECT_FALSE(EngineHelpers::isBcs(static_cast<aub_stream::EngineType>(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<FamilyType>::addBarrierWa(cmdStream, gpuAddress, this->pDevice->getRootDeviceEnvironment(), NEO::PostSyncMode::noWrite);
auto pipeControl = genCmdCast<PIPE_CONTROL *>(buffer);
ASSERT_NE(nullptr, pipeControl);
EXPECT_TRUE(pipeControl->getCommandStreamerStallEnable());
EXPECT_TRUE(pipeControl->getHdcPipelineFlush());
EXPECT_TRUE(pipeControl->getUnTypedDataPortCacheFlush());
}
XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, givenGfxCoreHelperWhenAskedIfFenceAllocationRequiredThenReturnCorrectValue) { XE_HPC_CORETEST_F(GfxCoreHelperTestsXeHpcCore, givenGfxCoreHelperWhenAskedIfFenceAllocationRequiredThenReturnCorrectValue) {
DebugManagerStateRestore dbgRestore; DebugManagerStateRestore dbgRestore;

View File

@@ -538,7 +538,6 @@ struct MemorySynchronizationCommands {
static void setPostSyncExtraProperties(PipeControlArgs &args); 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 setBarrierWa(void *&commandsBuffer, uint64_t gpuAddress, const RootDeviceEnvironment &rootDeviceEnvironment, NEO::PostSyncMode postSyncMode);
static void setBarrierWaFlags(void *barrierCmd); static void setBarrierWaFlags(void *barrierCmd);

View File

@@ -323,13 +323,6 @@ void MemorySynchronizationCommands<GfxFamily>::setSingleBarrier(void *commandsBu
*reinterpret_cast<PIPE_CONTROL *>(commandsBuffer) = pipeControl; *reinterpret_cast<PIPE_CONTROL *>(commandsBuffer) = pipeControl;
} }
template <typename GfxFamily>
void MemorySynchronizationCommands<GfxFamily>::addBarrierWa(LinearStream &commandStream, uint64_t gpuAddress, const RootDeviceEnvironment &rootDeviceEnvironment, NEO::PostSyncMode postSyncMode) {
size_t requiredSize = MemorySynchronizationCommands<GfxFamily>::getSizeForBarrierWa(rootDeviceEnvironment, postSyncMode);
void *commandBuffer = commandStream.getSpace(requiredSize);
setBarrierWa(commandBuffer, gpuAddress, rootDeviceEnvironment, postSyncMode);
}
template <typename GfxFamily> template <typename GfxFamily>
void MemorySynchronizationCommands<GfxFamily>::setBarrierWa(void *&commandsBuffer, uint64_t gpuAddress, const RootDeviceEnvironment &rootDeviceEnvironment, NEO::PostSyncMode postSyncMode) { void MemorySynchronizationCommands<GfxFamily>::setBarrierWa(void *&commandsBuffer, uint64_t gpuAddress, const RootDeviceEnvironment &rootDeviceEnvironment, NEO::PostSyncMode postSyncMode) {
using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL; using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL;

View File

@@ -194,10 +194,6 @@ inline void MemorySynchronizationCommands<Family>::setBarrierExtraProperties(voi
} }
} }
template <>
void MemorySynchronizationCommands<Family>::addBarrierWa(LinearStream &commandStream, uint64_t gpuAddress, const RootDeviceEnvironment &rootDeviceEnvironment, NEO::PostSyncMode postSyncMode) {
}
template <> template <>
void MemorySynchronizationCommands<Family>::setBarrierWa(void *&commandsBuffer, uint64_t gpuAddress, const RootDeviceEnvironment &rootDeviceEnvironment, NEO::PostSyncMode postSyncMode) { void MemorySynchronizationCommands<Family>::setBarrierWa(void *&commandsBuffer, uint64_t gpuAddress, const RootDeviceEnvironment &rootDeviceEnvironment, NEO::PostSyncMode postSyncMode) {
} }

View File

@@ -102,60 +102,6 @@ HWTEST2_F(GfxCoreHelperDg2AndLaterTest, givenGfxCoreHelperWhenCallCalculateMaxWo
using PipeControlHelperTestsDg2AndLater = ::testing::Test; 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<FamilyType>::getSizeForAdditionalSynchronization(NEO::FenceType::release, rootDeviceEnvironment) > 0) ? true : false;
for (auto ftrLocalMemory : ::testing::Bool()) {
LinearStream stream(buffer, 128);
hardwareInfo.featureTable.flags.ftrLocalMemory = ftrLocalMemory;
MemorySynchronizationCommands<FamilyType>::addBarrierWa(stream, address, rootDeviceEnvironment, NEO::PostSyncMode::immediateData);
if (MemorySynchronizationCommands<FamilyType>::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<FamilyType>::setPipeControlHdcPipelineFlush(expectedPipeControl, true);
expectedPipeControl.setUnTypedDataPortCacheFlush(true);
auto it = cmdList.begin();
auto pPipeControl = genCmdCast<PIPE_CONTROL *>(*it);
ASSERT_NE(nullptr, pPipeControl);
EXPECT_TRUE(memcmp(&expectedPipeControl, pPipeControl, sizeof(PIPE_CONTROL)) == 0);
if (requiresMemorySynchronization) {
if (UnitTestHelper<FamilyType>::isAdditionalMiSemaphoreWaitRequired(rootDeviceEnvironment)) {
MI_SEMAPHORE_WAIT expectedMiSemaphoreWait;
EncodeSemaphore<FamilyType>::programMiSemaphoreWait(&expectedMiSemaphoreWait, address,
EncodeSemaphore<FamilyType>::invalidHardwareTag,
MI_SEMAPHORE_WAIT::COMPARE_OPERATION::COMPARE_OPERATION_SAD_NOT_EQUAL_SDD,
false,
true,
false,
false,
false);
auto pMiSemaphoreWait = genCmdCast<MI_SEMAPHORE_WAIT *>(*(++it));
ASSERT_NE(nullptr, pMiSemaphoreWait);
EXPECT_TRUE(memcmp(&expectedMiSemaphoreWait, pMiSemaphoreWait, sizeof(MI_SEMAPHORE_WAIT)) == 0);
}
}
}
}
HWTEST2_F(PipeControlHelperTestsDg2AndLater, WhenSettingExtraPipeControlPropertiesThenCorrectValuesAreSet, IsAtLeastXeCore) { HWTEST2_F(PipeControlHelperTestsDg2AndLater, WhenSettingExtraPipeControlPropertiesThenCorrectValuesAreSet, IsAtLeastXeCore) {
PipeControlArgs args{}; PipeControlArgs args{};
MemorySynchronizationCommands<FamilyType>::setPostSyncExtraProperties(args); MemorySynchronizationCommands<FamilyType>::setPostSyncExtraProperties(args);

View File

@@ -460,22 +460,6 @@ XE2_HPG_CORETEST_F(GfxCoreHelperTestsXe2HpgCore, whenNonBcsEngineIsVerifiedThenR
EXPECT_FALSE(EngineHelpers::isBcs(static_cast<aub_stream::EngineType>(aub_stream::ENGINE_BCS8 + 1))); EXPECT_FALSE(EngineHelpers::isBcs(static_cast<aub_stream::EngineType>(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<FamilyType>::addBarrierWa(cmdStream, gpuAddress, this->pDevice->getRootDeviceEnvironment(), NEO::PostSyncMode::noWrite);
auto pipeControl = reinterpret_cast<PIPE_CONTROL *>(buffer);
EXPECT_TRUE(pipeControl->getCommandStreamerStallEnable());
EXPECT_TRUE(pipeControl->getDataportFlush());
EXPECT_TRUE(pipeControl->getUnTypedDataPortCacheFlush());
}
XE2_HPG_CORETEST_F(GfxCoreHelperTestsXe2HpgCore, givenGfxCoreHelperWhenAskedIfFenceAllocationRequiredThenReturnCorrectValue) { XE2_HPG_CORETEST_F(GfxCoreHelperTestsXe2HpgCore, givenGfxCoreHelperWhenAskedIfFenceAllocationRequiredThenReturnCorrectValue) {
DebugManagerStateRestore dbgRestore; DebugManagerStateRestore dbgRestore;

View File

@@ -147,42 +147,6 @@ XE_HPG_CORETEST_F(GfxCoreHelperTestXeHpgCore, GivenVariousValuesWhenAlignSlmSize
EXPECT_EQ(65536u, gfxCoreHelper.alignSlmSize(65536)); 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<FamilyType>::isBarrierWaRequired(rootDeviceEnvironment));
constexpr size_t bufferSize = 128u;
uint8_t buffer[bufferSize];
LinearStream cmdStream(buffer, bufferSize);
MemorySynchronizationCommands<FamilyType>::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<FamilyType>::isBarrierWaRequired(rootDeviceEnvironment));
constexpr size_t bufferSize = 128u;
uint8_t buffer[bufferSize];
LinearStream cmdStream(buffer, bufferSize);
MemorySynchronizationCommands<FamilyType>::addBarrierWa(cmdStream, 0x1000, rootDeviceEnvironment, NEO::PostSyncMode::noWrite);
EXPECT_EQ(0u, cmdStream.getUsed());
}
XE_HPG_CORETEST_F(GfxCoreHelperTestXeHpgCore, givenXeHpgCoreWhenCheckingIfEngineTypeRemappingIsRequiredThenReturnTrue) { XE_HPG_CORETEST_F(GfxCoreHelperTestXeHpgCore, givenXeHpgCoreWhenCheckingIfEngineTypeRemappingIsRequiredThenReturnTrue) {
auto &gfxCoreHelper = getHelper<GfxCoreHelper>(); auto &gfxCoreHelper = getHelper<GfxCoreHelper>();
EXPECT_FALSE(gfxCoreHelper.isEngineTypeRemappingToHwSpecificRequired()); EXPECT_FALSE(gfxCoreHelper.isEngineTypeRemappingToHwSpecificRequired());