From 02ebb857cb8597d3d5b328ea615b10c43c74a8b8 Mon Sep 17 00:00:00 2001 From: Bartosz Dunajski Date: Wed, 17 Apr 2024 15:43:32 +0000 Subject: [PATCH] fix: create new InOrderExecInfo on cmd list reset Signed-off-by: Bartosz Dunajski --- level_zero/core/source/cmdlist/cmdlist_hw.inl | 3 ++- .../unit_tests/sources/cmdlist/test_in_order_cmdlist.cpp | 6 +++++- shared/source/helpers/in_order_cmd_helpers.h | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/level_zero/core/source/cmdlist/cmdlist_hw.inl b/level_zero/core/source/cmdlist/cmdlist_hw.inl index 183f8bb3ec..865be2416f 100644 --- a/level_zero/core/source/cmdlist/cmdlist_hw.inl +++ b/level_zero/core/source/cmdlist/cmdlist_hw.inl @@ -145,7 +145,8 @@ ze_result_t CommandListCoreFamily::reset() { mappedTsEventList.clear(); if (inOrderExecInfo) { - inOrderExecInfo->reset(); + inOrderExecInfo.reset(); + enableInOrderExecution(); } latestOperationRequiredNonWalkerInOrderCmdsChaining = false; diff --git a/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist.cpp b/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist.cpp index d56301c441..5010a09aab 100644 --- a/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist.cpp +++ b/level_zero/core/test/unit_tests/sources/cmdlist/test_in_order_cmdlist.cpp @@ -5555,13 +5555,17 @@ HWTEST2_F(InOrderRegularCmdListTests, givenInOrderModeWhenDispatchingRegularCmdL } regularCmdList->inOrderExecInfo->setAllocationOffset(123); - auto hostAddr = static_cast(regularCmdList->inOrderExecInfo->getDeviceCounterAllocation()->getUnderlyingBuffer()); + auto hostAddr = static_cast(regularCmdList->inOrderExecInfo->getBaseHostAddress()); *hostAddr = 0x1234; regularCmdList->latestOperationRequiredNonWalkerInOrderCmdsChaining = true; + auto originalInOrderExecInfo = regularCmdList->inOrderExecInfo; + regularCmdList->reset(); + EXPECT_NE(originalInOrderExecInfo.get(), regularCmdList->inOrderExecInfo.get()); EXPECT_EQ(0u, regularCmdList->inOrderExecInfo->getCounterValue()); EXPECT_EQ(0u, regularCmdList->inOrderExecInfo->getAllocationOffset()); + hostAddr = static_cast(regularCmdList->inOrderExecInfo->getBaseHostAddress()); EXPECT_EQ(0u, *hostAddr); EXPECT_FALSE(regularCmdList->latestOperationRequiredNonWalkerInOrderCmdsChaining); } diff --git a/shared/source/helpers/in_order_cmd_helpers.h b/shared/source/helpers/in_order_cmd_helpers.h index e5d506bef1..3fb19a970d 100644 --- a/shared/source/helpers/in_order_cmd_helpers.h +++ b/shared/source/helpers/in_order_cmd_helpers.h @@ -86,6 +86,7 @@ class InOrderExecInfo : public NEO::NonCopyableClass { NEO::TagNodeBase *deviceCounterNode = nullptr; NEO::TagNodeBase *hostCounterNode = nullptr; uint64_t counterValue = 0; + uint64_t regularCmdListSubmissionCounter = 0; uint64_t deviceAddress = 0; uint64_t *hostAddress = nullptr;