fix: incorrect signaling in-order counter during region copy

Related-To: NEO-7966

Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz 2024-02-27 11:50:42 +00:00 committed by Compute-Runtime-Automation
parent 373ef608bc
commit fd91543d89
2 changed files with 13 additions and 5 deletions

View File

@ -1637,11 +1637,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendMemoryCopyRegion(void *d
if (this->isInOrderExecutionEnabled()) {
if (inOrderCopyOnlySignalingAllowed) {
appendSignalInOrderDependencyCounter(signalEvent);
}
if (!isCopyOnly() || inOrderCopyOnlySignalingAllowed) {
bool nonWalkerInOrderCmdChaining = !isCopyOnly() && isInOrderNonWalkerSignalingRequired(signalEvent);
handleInOrderDependencyCounter(signalEvent, nonWalkerInOrderCmdChaining);
handleInOrderDependencyCounter(signalEvent, false);
}
} else {
handleInOrderDependencyCounter(signalEvent, false);

View File

@ -940,50 +940,62 @@ HWTEST2_F(InOrderCmdListTests, givenCmdsChainingWhenDispatchingKernelThenProgram
immCmdList->appendLaunchKernel(kernel->toHandle(), groupCount, eventHandle, 0, nullptr, launchParams, false);
findSemaphores(1); // chaining
EXPECT_EQ(1u, immCmdList->inOrderExecInfo->getCounterValue());
offset = cmdStream->getUsed();
immCmdList->appendLaunchKernel(kernel->toHandle(), groupCount, nullptr, 0, nullptr, launchParams, false);
findSemaphores(0); // no implicit dependency semaphore
EXPECT_EQ(2u, immCmdList->inOrderExecInfo->getCounterValue());
offset = cmdStream->getUsed();
immCmdList->appendLaunchKernel(kernel->toHandle(), groupCount, eventHandle, 0, nullptr, launchParams, false);
findSemaphores(2); // implicit dependency + chaining
EXPECT_EQ(3u, immCmdList->inOrderExecInfo->getCounterValue());
offset = cmdStream->getUsed();
immCmdList->appendMemoryCopy(&copyData, &copyData, 1, nullptr, 0, nullptr, false, false);
findSemaphores(0); // no implicit dependency
EXPECT_EQ(4u, immCmdList->inOrderExecInfo->getCounterValue());
offset = cmdStream->getUsed();
immCmdList->appendLaunchKernel(kernel->toHandle(), groupCount, eventHandle, 0, nullptr, launchParams, false);
findSemaphores(2); // implicit dependency + chaining
EXPECT_EQ(5u, immCmdList->inOrderExecInfo->getCounterValue());
offset = cmdStream->getUsed();
immCmdList->appendMemoryCopyRegion(&copyData, &region, 1, 1, &copyData, &region, 1, 1, nullptr, 0, nullptr, false, false);
findSemaphores(0); // no implicit dependency
EXPECT_EQ(6u, immCmdList->inOrderExecInfo->getCounterValue());
offset = cmdStream->getUsed();
immCmdList->appendLaunchKernel(kernel->toHandle(), groupCount, eventHandle, 0, nullptr, launchParams, false);
findSemaphores(2); // implicit dependency + chaining
EXPECT_EQ(7u, immCmdList->inOrderExecInfo->getCounterValue());
offset = cmdStream->getUsed();
immCmdList->appendMemoryFill(alloc, &copyData, 1, 16, nullptr, 0, nullptr, false);
findSemaphores(0); // no implicit dependency
EXPECT_EQ(8u, immCmdList->inOrderExecInfo->getCounterValue());
offset = cmdStream->getUsed();
immCmdList->appendLaunchKernel(kernel->toHandle(), groupCount, eventHandle, 0, nullptr, launchParams, false);
findSemaphores(2); // implicit dependency + chaining
EXPECT_EQ(9u, immCmdList->inOrderExecInfo->getCounterValue());
offset = cmdStream->getUsed();
immCmdList->appendLaunchKernelIndirect(kernel->toHandle(), *static_cast<ze_group_count_t *>(alloc), nullptr, 0, nullptr, false);
findSemaphores(0); // no implicit dependency
EXPECT_EQ(10u, immCmdList->inOrderExecInfo->getCounterValue());
offset = cmdStream->getUsed();
immCmdList->appendLaunchKernel(kernel->toHandle(), groupCount, eventHandle, 0, nullptr, launchParams, false);
findSemaphores(2); // implicit dependency + chaining
EXPECT_EQ(11u, immCmdList->inOrderExecInfo->getCounterValue());
offset = cmdStream->getUsed();
immCmdList->appendLaunchCooperativeKernel(kernel->toHandle(), groupCount, nullptr, 0, nullptr, false);
findSemaphores(0); // no implicit dependency
EXPECT_EQ(12u, immCmdList->inOrderExecInfo->getCounterValue());
context->freeMem(alloc);
}