feature: store post sync command in out postsync command pointer
Related-To: NEO-10064 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
parent
1b9f3f11a0
commit
36ca1bbe2d
|
@ -3593,6 +3593,10 @@ void CommandListCoreFamily<gfxCoreFamily>::dispatchPostSyncCommands(const CmdLis
|
||||||
value,
|
value,
|
||||||
device->getNEODevice()->getRootDeviceEnvironment(),
|
device->getNEODevice()->getRootDeviceEnvironment(),
|
||||||
pipeControlArgs);
|
pipeControlArgs);
|
||||||
|
|
||||||
|
if (syncCmdBuffer != nullptr) {
|
||||||
|
*syncCmdBuffer = pipeControlArgs.postSyncCmd;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventOperations.isTimestmapEvent && !skipPartitionOffsetProgramming) {
|
if (eventOperations.isTimestmapEvent && !skipPartitionOffsetProgramming) {
|
||||||
|
|
|
@ -2398,9 +2398,13 @@ HWTEST2_F(CommandListCreate, givenPlatformSupportsHdcUntypedCacheFlushWhenAppend
|
||||||
}
|
}
|
||||||
|
|
||||||
HWTEST2_F(CommandListCreate, givenAppendSignalEventWhenSkipAddToResidencyTrueThenEventAllocationNotAddedToResidency, IsAtLeastXeHpCore) {
|
HWTEST2_F(CommandListCreate, givenAppendSignalEventWhenSkipAddToResidencyTrueThenEventAllocationNotAddedToResidency, IsAtLeastXeHpCore) {
|
||||||
|
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
|
||||||
|
using POST_SYNC_OPERATION = typename PIPE_CONTROL::POST_SYNC_OPERATION;
|
||||||
|
|
||||||
auto commandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
auto commandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
||||||
auto result = commandList->initialize(device, NEO::EngineGroupType::compute, 0u);
|
auto result = commandList->initialize(device, NEO::EngineGroupType::compute, 0u);
|
||||||
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
|
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
|
||||||
|
auto &commandContainer = commandList->getCmdContainer();
|
||||||
|
|
||||||
ze_event_pool_desc_t eventPoolDesc = {};
|
ze_event_pool_desc_t eventPoolDesc = {};
|
||||||
eventPoolDesc.count = 1;
|
eventPoolDesc.count = 1;
|
||||||
|
@ -2415,20 +2419,62 @@ HWTEST2_F(CommandListCreate, givenAppendSignalEventWhenSkipAddToResidencyTrueThe
|
||||||
auto event = std::unique_ptr<L0::Event>(L0::Event::create<typename FamilyType::TimestampPacketType>(eventPool.get(), &eventDesc, device));
|
auto event = std::unique_ptr<L0::Event>(L0::Event::create<typename FamilyType::TimestampPacketType>(eventPool.get(), &eventDesc, device));
|
||||||
ASSERT_NE(nullptr, event.get());
|
ASSERT_NE(nullptr, event.get());
|
||||||
|
|
||||||
auto &residencyContainer = commandList->getCmdContainer().getResidencyContainer();
|
auto &residencyContainer = commandContainer.getResidencyContainer();
|
||||||
auto eventAllocation = event->getPoolAllocation(device);
|
auto eventAllocation = event->getPoolAllocation(device);
|
||||||
|
|
||||||
|
void *pipeControlBuffer = nullptr;
|
||||||
|
|
||||||
|
auto commandStreamOffset = commandContainer.getCommandStream()->getUsed();
|
||||||
bool skipAdd = true;
|
bool skipAdd = true;
|
||||||
commandList->appendEventForProfilingAllWalkers(event.get(), nullptr, false, true, skipAdd);
|
commandList->appendEventForProfilingAllWalkers(event.get(), &pipeControlBuffer, false, true, skipAdd);
|
||||||
|
|
||||||
auto eventAllocIt = std::find(residencyContainer.begin(), residencyContainer.end(), eventAllocation);
|
auto eventAllocIt = std::find(residencyContainer.begin(), residencyContainer.end(), eventAllocation);
|
||||||
EXPECT_EQ(residencyContainer.end(), eventAllocIt);
|
EXPECT_EQ(residencyContainer.end(), eventAllocIt);
|
||||||
|
|
||||||
skipAdd = false;
|
ASSERT_NE(nullptr, pipeControlBuffer);
|
||||||
|
GenCmdList cmdList;
|
||||||
|
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(
|
||||||
|
cmdList,
|
||||||
|
ptrOffset(commandContainer.getCommandStream()->getCpuBase(), commandStreamOffset),
|
||||||
|
commandContainer.getCommandStream()->getUsed() - commandStreamOffset));
|
||||||
|
|
||||||
commandList->appendEventForProfilingAllWalkers(event.get(), nullptr, false, true, skipAdd);
|
auto pcList = findAll<PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
|
||||||
|
ASSERT_NE(0u, pcList.size());
|
||||||
|
|
||||||
|
PIPE_CONTROL *postSyncPipeControl = nullptr;
|
||||||
|
for (const auto it : pcList) {
|
||||||
|
postSyncPipeControl = genCmdCast<PIPE_CONTROL *>(*it);
|
||||||
|
if (postSyncPipeControl->getPostSyncOperation() == POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ASSERT_NE(nullptr, postSyncPipeControl);
|
||||||
|
ASSERT_EQ(postSyncPipeControl, pipeControlBuffer);
|
||||||
|
|
||||||
|
commandStreamOffset = commandContainer.getCommandStream()->getUsed();
|
||||||
|
skipAdd = false;
|
||||||
|
commandList->appendEventForProfilingAllWalkers(event.get(), &pipeControlBuffer, false, true, skipAdd);
|
||||||
eventAllocIt = std::find(residencyContainer.begin(), residencyContainer.end(), eventAllocation);
|
eventAllocIt = std::find(residencyContainer.begin(), residencyContainer.end(), eventAllocation);
|
||||||
EXPECT_NE(residencyContainer.end(), eventAllocIt);
|
EXPECT_NE(residencyContainer.end(), eventAllocIt);
|
||||||
|
|
||||||
|
cmdList.clear();
|
||||||
|
ASSERT_TRUE(FamilyType::Parse::parseCommandBuffer(
|
||||||
|
cmdList,
|
||||||
|
ptrOffset(commandContainer.getCommandStream()->getCpuBase(), commandStreamOffset),
|
||||||
|
commandContainer.getCommandStream()->getUsed() - commandStreamOffset));
|
||||||
|
|
||||||
|
pcList = findAll<PIPE_CONTROL *>(cmdList.begin(), cmdList.end());
|
||||||
|
ASSERT_NE(0u, pcList.size());
|
||||||
|
|
||||||
|
postSyncPipeControl = nullptr;
|
||||||
|
for (const auto it : pcList) {
|
||||||
|
postSyncPipeControl = genCmdCast<PIPE_CONTROL *>(*it);
|
||||||
|
if (postSyncPipeControl->getPostSyncOperation() == POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ASSERT_NE(nullptr, postSyncPipeControl);
|
||||||
|
ASSERT_EQ(postSyncPipeControl, pipeControlBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ult
|
} // namespace ult
|
||||||
|
|
Loading…
Reference in New Issue