feature: dont reset combined TS packets

Related-To: NEO-13971

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski 2025-02-21 10:29:05 +00:00 committed by Compute-Runtime-Automation
parent 5961850bbc
commit 546e8fa230
4 changed files with 5 additions and 18 deletions

View File

@ -667,15 +667,7 @@ void Event::unsetInOrderExecInfo() {
} }
void Event::resetInOrderTimestampNode(NEO::TagNodeBase *newNode, uint32_t partitionCount) { void Event::resetInOrderTimestampNode(NEO::TagNodeBase *newNode, uint32_t partitionCount) {
bool removeExistingNodes = inOrderIncrementValue == 0 || !newNode; if (inOrderIncrementValue == 0 || !newNode) {
if (inOrderIncrementValue > 0 && inOrderTimestampNode.size() == inOrderIncrementOperationsCount) {
// Increment event reused. Collect new TS nodes.
removeExistingNodes = true;
inOrderExecInfo->releaseNotUsedTempTimestampNodes(true);
}
if (removeExistingNodes) {
for (auto &node : inOrderTimestampNode) { for (auto &node : inOrderTimestampNode) {
inOrderExecInfo->pushTempTimestampNode(node, inOrderExecSignalValue); inOrderExecInfo->pushTempTimestampNode(node, inOrderExecSignalValue);
} }
@ -756,7 +748,6 @@ ze_result_t Event::enableExtensions(const EventDescriptor &eventDescriptor) {
updateInOrderExecState(inOrderExecInfo, externalStorageProperties->completionValue, 0); updateInOrderExecState(inOrderExecInfo, externalStorageProperties->completionValue, 0);
this->inOrderIncrementValue = externalStorageProperties->incrementValue; this->inOrderIncrementValue = externalStorageProperties->incrementValue;
this->inOrderIncrementOperationsCount = static_cast<uint32_t>(externalStorageProperties->completionValue / externalStorageProperties->incrementValue);
} }
extendedDesc = reinterpret_cast<const ze_base_desc_t *>(extendedDesc->pNext); extendedDesc = reinterpret_cast<const ze_base_desc_t *>(extendedDesc->pNext);

View File

@ -356,7 +356,6 @@ struct Event : _ze_event_handle_t {
uint64_t inOrderExecSignalValue = 0; uint64_t inOrderExecSignalValue = 0;
uint64_t inOrderIncrementValue = 0; uint64_t inOrderIncrementValue = 0;
uint32_t inOrderIncrementOperationsCount = 0;
uint32_t inOrderAllocationOffset = 0; uint32_t inOrderAllocationOffset = 0;
std::chrono::microseconds gpuHangCheckPeriod{CommonConstants::gpuHangCheckTimeInUS}; std::chrono::microseconds gpuHangCheckPeriod{CommonConstants::gpuHangCheckTimeInUS};

View File

@ -192,7 +192,7 @@ ze_result_t EventImp<TagSizeT>::calculateProfilingData() {
auto numPackets = eventCompletion.getPacketsUsed(); auto numPackets = eventCompletion.getPacketsUsed();
if (inOrderIncrementValue > 0) { if (inOrderIncrementValue > 0) {
numPackets *= inOrderIncrementOperationsCount; numPackets *= static_cast<uint32_t>(inOrderTimestampNode.size());
} }
for (auto packetId = 0u; packetId < numPackets; packetId++) { for (auto packetId = 0u; packetId < numPackets; packetId++) {
@ -240,7 +240,7 @@ void EventImp<TagSizeT>::assignKernelEventCompletionData(void *address) {
for (uint32_t i = 0; i < kernelCount; i++) { for (uint32_t i = 0; i < kernelCount; i++) {
uint32_t packetsToCopy = kernelEventCompletionData[i].getPacketsUsed(); uint32_t packetsToCopy = kernelEventCompletionData[i].getPacketsUsed();
if (inOrderIncrementValue > 0) { if (inOrderIncrementValue > 0) {
packetsToCopy *= inOrderIncrementOperationsCount; packetsToCopy *= static_cast<uint32_t>(inOrderTimestampNode.size());
} }
uint32_t nodeId = 0; uint32_t nodeId = 0;

View File

@ -5470,7 +5470,7 @@ HWTEST2_F(InOrderCmdListTests, givenExternalSyncStorageWhenCallingAppendThenHand
context->freeMem(devAddress); context->freeMem(devAddress);
} }
HWTEST2_F(InOrderCmdListTests, givenExternalSyncStorageWhenCallingAppendMoreThanCounterValueThenResetNodes, MatchAny) { HWTEST2_F(InOrderCmdListTests, givenExternalSyncStorageWhenCallingAppendMoreThanCounterValueThenDontResetNodes, MatchAny) {
using TagSizeT = typename FamilyType::TimestampPacketType; using TagSizeT = typename FamilyType::TimestampPacketType;
constexpr uint64_t counterValue = 4; constexpr uint64_t counterValue = 4;
@ -5486,11 +5486,8 @@ HWTEST2_F(InOrderCmdListTests, givenExternalSyncStorageWhenCallingAppendMoreThan
auto immCmdList = createImmCmdList<gfxCoreFamily>(); auto immCmdList = createImmCmdList<gfxCoreFamily>();
immCmdList->appendLaunchKernel(kernel->toHandle(), groupCount, handle, 0, nullptr, launchParams, false); immCmdList->appendLaunchKernel(kernel->toHandle(), groupCount, handle, 0, nullptr, launchParams, false);
immCmdList->appendLaunchKernel(kernel->toHandle(), groupCount, handle, 0, nullptr, launchParams, false); immCmdList->appendLaunchKernel(kernel->toHandle(), groupCount, handle, 0, nullptr, launchParams, false);
ASSERT_EQ(2u, eventObj->inOrderTimestampNode.size());
immCmdList->appendLaunchKernel(kernel->toHandle(), groupCount, handle, 0, nullptr, launchParams, false); immCmdList->appendLaunchKernel(kernel->toHandle(), groupCount, handle, 0, nullptr, launchParams, false);
ASSERT_EQ(1u, eventObj->inOrderTimestampNode.size()); ASSERT_EQ(3u, eventObj->inOrderTimestampNode.size());
context->freeMem(devAddress); context->freeMem(devAddress);
} }