fix: unregister CSR client on queue synchronize

Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz 2023-09-01 11:02:15 +00:00 committed by Compute-Runtime-Automation
parent 4222a3a9bc
commit a7e2ac20de
2 changed files with 23 additions and 0 deletions

View File

@ -211,6 +211,8 @@ void CommandQueueImp::postSyncOperations(bool hangDetected) {
if (NEO::Debugger::isDebugEnabled(internalUsage) && device->getL0Debugger() && NEO::DebugManager.flags.DebuggerLogBitmask.get()) {
device->getL0Debugger()->printTrackedAddresses(csr->getOsContext().getContextId());
}
unregisterCsrClient();
}
CommandQueue *CommandQueue::create(uint32_t productFamily, Device *device, NEO::CommandStreamReceiver *csr,

View File

@ -1550,6 +1550,27 @@ HWTEST_F(PrimaryBatchBufferCmdListTest, givenRegularCmdListWhenFlushingThenPassS
EXPECT_TRUE(ultCsr->latestFlushedBatchBuffer.hasStallingCmds);
}
HWTEST_F(PrimaryBatchBufferCmdListTest, givenCmdListWhenCallingSynchronizeThenUnregisterCsrClient) {
ze_group_count_t groupCount{1, 1, 1};
CmdListKernelLaunchParams launchParams = {};
EXPECT_EQ(ZE_RESULT_SUCCESS, commandList->appendLaunchKernel(kernel->toHandle(), &groupCount, nullptr, 0, nullptr, launchParams, false));
EXPECT_EQ(ZE_RESULT_SUCCESS, commandList->close());
auto csr = commandQueue->getCsr();
auto numClients = csr->getNumClients();
auto cmdListHandle = commandList->toHandle();
EXPECT_EQ(ZE_RESULT_SUCCESS, commandQueue->executeCommandLists(1, &cmdListHandle, nullptr, true));
EXPECT_EQ(numClients + 1, csr->getNumClients());
commandQueue->synchronize(std::numeric_limits<uint64_t>::max());
EXPECT_EQ(numClients, csr->getNumClients());
}
HWTEST_F(PrimaryBatchBufferCmdListTest, givenPrimaryBatchBufferWhenCopyCommandListAndQueueAreCreatedThenFirstDispatchCreatesGlobalInitPreambleAndLaterDispatchProvideCmdListBuffer) {
using MI_BATCH_BUFFER_START = typename FamilyType::MI_BATCH_BUFFER_START;