diff --git a/level_zero/core/source/event/event_impl.inl b/level_zero/core/source/event/event_impl.inl index f17d231dc1..c1f7d7b775 100644 --- a/level_zero/core/source/event/event_impl.inl +++ b/level_zero/core/source/event/event_impl.inl @@ -277,13 +277,11 @@ void EventImp::downloadAllTbxAllocations() { csr->downloadAllocations(true, taskCount); } - for (auto &subDevice : this->device->getNEODevice()->getRootDevice()->getSubDevices()) { - for (auto const &engine : subDevice->getAllEngines()) { - auto taskCount = getTaskCount(*engine.commandStreamReceiver); + for (auto &engine : this->device->getNEODevice()->getMemoryManager()->getRegisteredEngines()[this->device->getRootDeviceIndex()]) { + auto taskCount = getTaskCount(*engine.commandStreamReceiver); - if (taskCount != NEO::GraphicsAllocation::objectNotUsed) { - engine.commandStreamReceiver->downloadAllocations(false, taskCount); - } + if (taskCount != NEO::GraphicsAllocation::objectNotUsed) { + engine.commandStreamReceiver->downloadAllocations(false, taskCount); } } } diff --git a/level_zero/core/test/unit_tests/sources/event/test_event.cpp b/level_zero/core/test/unit_tests/sources/event/test_event.cpp index d92cba766c..a90e37cd9d 100644 --- a/level_zero/core/test/unit_tests/sources/event/test_event.cpp +++ b/level_zero/core/test/unit_tests/sources/event/test_event.cpp @@ -3295,7 +3295,7 @@ HWTEST_F(EventTests, GivenEventWhenHostSynchronizeCalledThenExpectDownloadEventA downloadedAllocations = downloadAllocationTrack[eventAllocation]; EXPECT_EQ(iterations + 1u, downloadedAllocations); - EXPECT_EQ(1u, ultCsr->downloadAllocationsCalledCount); + EXPECT_EQ(2u, ultCsr->downloadAllocationsCalledCount); event->destroy(); } @@ -4302,9 +4302,11 @@ HWTEST2_F(EventMultiTileDynamicPacketUseTest, givenEventUsedCreatedOnSubDeviceBu auto subDevice0 = rootDevice->subDevices[0]; auto subDevice1 = rootDevice->subDevices[1]; + auto rootCsr = static_cast *>(rootDevice->getNEODevice()->getDefaultEngine().commandStreamReceiver); auto ultCsr0 = static_cast *>(subDevice0->getNEODevice()->getDefaultEngine().commandStreamReceiver); auto ultCsr1 = static_cast *>(subDevice1->getNEODevice()->getDefaultEngine().commandStreamReceiver); + rootCsr->commandStreamReceiverType = CommandStreamReceiverType::tbx; ultCsr0->commandStreamReceiverType = CommandStreamReceiverType::tbx; ultCsr1->commandStreamReceiverType = CommandStreamReceiverType::tbx; @@ -4324,9 +4326,13 @@ HWTEST2_F(EventMultiTileDynamicPacketUseTest, givenEventUsedCreatedOnSubDeviceBu TagAddressType *eventAddress = static_cast(ptrOffset(event->getHostAddress(), eventCompletionOffset)); *eventAddress = Event::STATE_INITIAL; + uint32_t rootDownloadCounter = 0; uint32_t downloadCounter0 = 0; uint32_t downloadCounter1 = 0; + rootCsr->downloadAllocationImpl = [&rootDownloadCounter](GraphicsAllocation &gfxAllocation) { + rootDownloadCounter++; + }; ultCsr0->downloadAllocationImpl = [&downloadCounter0](GraphicsAllocation &gfxAllocation) { downloadCounter0++; }; @@ -4336,12 +4342,17 @@ HWTEST2_F(EventMultiTileDynamicPacketUseTest, givenEventUsedCreatedOnSubDeviceBu auto eventAllocation = event->getPoolAllocation(device); ultCsr0->makeResident(*eventAllocation); + rootCsr->makeResident(*eventAllocation); auto hostAddress = static_cast(event->getCompletionFieldHostAddress()); *hostAddress = Event::STATE_SIGNALED; event->hostSynchronize(1); + EXPECT_EQ(1u, rootCsr->downloadAllocationsCalledCount); + EXPECT_FALSE(rootCsr->latestDownloadAllocationsBlocking); + EXPECT_EQ(0u, rootDownloadCounter); + EXPECT_EQ(1u, ultCsr0->downloadAllocationsCalledCount); EXPECT_FALSE(ultCsr0->latestDownloadAllocationsBlocking); EXPECT_EQ(1u, downloadCounter0);