From 546e8fa230d3a24ce2ed4ecdd9204d3d4fc2342e Mon Sep 17 00:00:00 2001 From: Bartosz Dunajski Date: Fri, 21 Feb 2025 10:29:05 +0000 Subject: [PATCH] feature: dont reset combined TS packets Related-To: NEO-13971 Signed-off-by: Bartosz Dunajski --- level_zero/core/source/event/event.cpp | 11 +---------- level_zero/core/source/event/event.h | 1 - level_zero/core/source/event/event_impl.inl | 4 ++-- .../sources/cmdlist/test_in_order_cmdlist_1.cpp | 7 ++----- 4 files changed, 5 insertions(+), 18 deletions(-) diff --git a/level_zero/core/source/event/event.cpp b/level_zero/core/source/event/event.cpp index 2eb4176d7e..a2c9299117 100644 --- a/level_zero/core/source/event/event.cpp +++ b/level_zero/core/source/event/event.cpp @@ -667,15 +667,7 @@ void Event::unsetInOrderExecInfo() { } void Event::resetInOrderTimestampNode(NEO::TagNodeBase *newNode, uint32_t partitionCount) { - bool removeExistingNodes = inOrderIncrementValue == 0 || !newNode; - - if (inOrderIncrementValue > 0 && inOrderTimestampNode.size() == inOrderIncrementOperationsCount) { - // Increment event reused. Collect new TS nodes. - removeExistingNodes = true; - inOrderExecInfo->releaseNotUsedTempTimestampNodes(true); - } - - if (removeExistingNodes) { + if (inOrderIncrementValue == 0 || !newNode) { for (auto &node : inOrderTimestampNode) { inOrderExecInfo->pushTempTimestampNode(node, inOrderExecSignalValue); } @@ -756,7 +748,6 @@ ze_result_t Event::enableExtensions(const EventDescriptor &eventDescriptor) { updateInOrderExecState(inOrderExecInfo, externalStorageProperties->completionValue, 0); this->inOrderIncrementValue = externalStorageProperties->incrementValue; - this->inOrderIncrementOperationsCount = static_cast(externalStorageProperties->completionValue / externalStorageProperties->incrementValue); } extendedDesc = reinterpret_cast(extendedDesc->pNext); diff --git a/level_zero/core/source/event/event.h b/level_zero/core/source/event/event.h index 30e3321bca..4db69e0fd6 100644 --- a/level_zero/core/source/event/event.h +++ b/level_zero/core/source/event/event.h @@ -356,7 +356,6 @@ struct Event : _ze_event_handle_t { uint64_t inOrderExecSignalValue = 0; uint64_t inOrderIncrementValue = 0; - uint32_t inOrderIncrementOperationsCount = 0; uint32_t inOrderAllocationOffset = 0; std::chrono::microseconds gpuHangCheckPeriod{CommonConstants::gpuHangCheckTimeInUS}; diff --git a/level_zero/core/source/event/event_impl.inl b/level_zero/core/source/event/event_impl.inl index e6b7e37c7d..cec12a7800 100644 --- a/level_zero/core/source/event/event_impl.inl +++ b/level_zero/core/source/event/event_impl.inl @@ -192,7 +192,7 @@ ze_result_t EventImp::calculateProfilingData() { auto numPackets = eventCompletion.getPacketsUsed(); if (inOrderIncrementValue > 0) { - numPackets *= inOrderIncrementOperationsCount; + numPackets *= static_cast(inOrderTimestampNode.size()); } for (auto packetId = 0u; packetId < numPackets; packetId++) { @@ -240,7 +240,7 @@ void EventImp::assignKernelEventCompletionData(void *address) { for (uint32_t i = 0; i < kernelCount; i++) { uint32_t packetsToCopy = kernelEventCompletionData[i].getPacketsUsed(); if (inOrderIncrementValue > 0) { - packetsToCopy *= inOrderIncrementOperationsCount; + packetsToCopy *= static_cast(inOrderTimestampNode.size()); } uint32_t nodeId = 0; diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_1.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_1.cpp index 27eea089ad..da0d0dd6a2 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_1.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_1.cpp @@ -5470,7 +5470,7 @@ HWTEST2_F(InOrderCmdListTests, givenExternalSyncStorageWhenCallingAppendThenHand context->freeMem(devAddress); } -HWTEST2_F(InOrderCmdListTests, givenExternalSyncStorageWhenCallingAppendMoreThanCounterValueThenResetNodes, MatchAny) { +HWTEST2_F(InOrderCmdListTests, givenExternalSyncStorageWhenCallingAppendMoreThanCounterValueThenDontResetNodes, MatchAny) { using TagSizeT = typename FamilyType::TimestampPacketType; constexpr uint64_t counterValue = 4; @@ -5486,11 +5486,8 @@ HWTEST2_F(InOrderCmdListTests, givenExternalSyncStorageWhenCallingAppendMoreThan auto immCmdList = createImmCmdList(); 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); - ASSERT_EQ(1u, eventObj->inOrderTimestampNode.size()); + ASSERT_EQ(3u, eventObj->inOrderTimestampNode.size()); context->freeMem(devAddress); }