Skip to content

Commit 546e8fa

Browse files
feature: dont reset combined TS packets
Related-To: NEO-13971 Signed-off-by: Bartosz Dunajski <[email protected]>
1 parent 5961850 commit 546e8fa

File tree

4 files changed

+5
-18
lines changed

4 files changed

+5
-18
lines changed

level_zero/core/source/event/event.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -667,15 +667,7 @@ void Event::unsetInOrderExecInfo() {
667667
}
668668

669669
void Event::resetInOrderTimestampNode(NEO::TagNodeBase *newNode, uint32_t partitionCount) {
670-
bool removeExistingNodes = inOrderIncrementValue == 0 || !newNode;
671-
672-
if (inOrderIncrementValue > 0 && inOrderTimestampNode.size() == inOrderIncrementOperationsCount) {
673-
// Increment event reused. Collect new TS nodes.
674-
removeExistingNodes = true;
675-
inOrderExecInfo->releaseNotUsedTempTimestampNodes(true);
676-
}
677-
678-
if (removeExistingNodes) {
670+
if (inOrderIncrementValue == 0 || !newNode) {
679671
for (auto &node : inOrderTimestampNode) {
680672
inOrderExecInfo->pushTempTimestampNode(node, inOrderExecSignalValue);
681673
}
@@ -756,7 +748,6 @@ ze_result_t Event::enableExtensions(const EventDescriptor &eventDescriptor) {
756748
updateInOrderExecState(inOrderExecInfo, externalStorageProperties->completionValue, 0);
757749

758750
this->inOrderIncrementValue = externalStorageProperties->incrementValue;
759-
this->inOrderIncrementOperationsCount = static_cast<uint32_t>(externalStorageProperties->completionValue / externalStorageProperties->incrementValue);
760751
}
761752

762753
extendedDesc = reinterpret_cast<const ze_base_desc_t *>(extendedDesc->pNext);

level_zero/core/source/event/event.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@ struct Event : _ze_event_handle_t {
356356

357357
uint64_t inOrderExecSignalValue = 0;
358358
uint64_t inOrderIncrementValue = 0;
359-
uint32_t inOrderIncrementOperationsCount = 0;
360359
uint32_t inOrderAllocationOffset = 0;
361360

362361
std::chrono::microseconds gpuHangCheckPeriod{CommonConstants::gpuHangCheckTimeInUS};

level_zero/core/source/event/event_impl.inl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ ze_result_t EventImp<TagSizeT>::calculateProfilingData() {
192192

193193
auto numPackets = eventCompletion.getPacketsUsed();
194194
if (inOrderIncrementValue > 0) {
195-
numPackets *= inOrderIncrementOperationsCount;
195+
numPackets *= static_cast<uint32_t>(inOrderTimestampNode.size());
196196
}
197197

198198
for (auto packetId = 0u; packetId < numPackets; packetId++) {
@@ -240,7 +240,7 @@ void EventImp<TagSizeT>::assignKernelEventCompletionData(void *address) {
240240
for (uint32_t i = 0; i < kernelCount; i++) {
241241
uint32_t packetsToCopy = kernelEventCompletionData[i].getPacketsUsed();
242242
if (inOrderIncrementValue > 0) {
243-
packetsToCopy *= inOrderIncrementOperationsCount;
243+
packetsToCopy *= static_cast<uint32_t>(inOrderTimestampNode.size());
244244
}
245245

246246
uint32_t nodeId = 0;

level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist_1.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5470,7 +5470,7 @@ HWTEST2_F(InOrderCmdListTests, givenExternalSyncStorageWhenCallingAppendThenHand
54705470
context->freeMem(devAddress);
54715471
}
54725472

5473-
HWTEST2_F(InOrderCmdListTests, givenExternalSyncStorageWhenCallingAppendMoreThanCounterValueThenResetNodes, MatchAny) {
5473+
HWTEST2_F(InOrderCmdListTests, givenExternalSyncStorageWhenCallingAppendMoreThanCounterValueThenDontResetNodes, MatchAny) {
54745474
using TagSizeT = typename FamilyType::TimestampPacketType;
54755475

54765476
constexpr uint64_t counterValue = 4;
@@ -5486,11 +5486,8 @@ HWTEST2_F(InOrderCmdListTests, givenExternalSyncStorageWhenCallingAppendMoreThan
54865486
auto immCmdList = createImmCmdList<gfxCoreFamily>();
54875487
immCmdList->appendLaunchKernel(kernel->toHandle(), groupCount, handle, 0, nullptr, launchParams, false);
54885488
immCmdList->appendLaunchKernel(kernel->toHandle(), groupCount, handle, 0, nullptr, launchParams, false);
5489-
5490-
ASSERT_EQ(2u, eventObj->inOrderTimestampNode.size());
5491-
54925489
immCmdList->appendLaunchKernel(kernel->toHandle(), groupCount, handle, 0, nullptr, launchParams, false);
5493-
ASSERT_EQ(1u, eventObj->inOrderTimestampNode.size());
5490+
ASSERT_EQ(3u, eventObj->inOrderTimestampNode.size());
54945491

54955492
context->freeMem(devAddress);
54965493
}

0 commit comments

Comments
 (0)