diff --git a/Jenkinsfile b/Jenkinsfile index 08bf2407f0..6ea25dc25d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,4 +1,4 @@ #!groovy neoDependenciesRev='794280-1087' strategy='EQUAL' -allowedCD=273 +allowedCD=272 diff --git a/runtime/command_queue/command_queue.cpp b/runtime/command_queue/command_queue.cpp index 48f0b1decc..b36bc53b56 100644 --- a/runtime/command_queue/command_queue.cpp +++ b/runtime/command_queue/command_queue.cpp @@ -320,21 +320,6 @@ void CommandQueue::updateFromCompletionStamp(const CompletionStamp &completionSt this->taskLevel = completionStamp.taskLevel; } -void CommandQueue::flushWaitList( - cl_uint numEventsInWaitList, - const cl_event *eventWaitList, - bool ndRangeKernel) { - - bool isQBlocked = false; - - //as long as queue is blocked we need to stall. - if (!isOOQEnabled()) { - while ((isQBlocked = isQueueBlocked())) - ; - } - device->getCommandStreamReceiver().flushBatchedSubmissions(); -} - bool CommandQueue::setPerfCountersEnabled(bool perfCountersEnabled, cl_uint configuration) { DEBUG_BREAK_IF(device == nullptr); if (perfCountersEnabled == this->perfCountersEnabled) { diff --git a/runtime/command_queue/command_queue.h b/runtime/command_queue/command_queue.h index 0c8fc6762d..e506f9e9c5 100644 --- a/runtime/command_queue/command_queue.h +++ b/runtime/command_queue/command_queue.h @@ -320,10 +320,6 @@ class CommandQueue : public BaseObject<_cl_command_queue> { MOCKABLE_VIRTUAL void waitUntilComplete(uint32_t taskCountToWait, FlushStamp flushStampToWait, bool useQuickKmdSleep); - void flushWaitList(cl_uint numEventsInWaitList, - const cl_event *eventWaitList, - bool ndRangeKernel); - static uint32_t getTaskLevelFromWaitList(uint32_t taskLevel, cl_uint numEventsInWaitList, const cl_event *eventWaitList); diff --git a/runtime/event/event.cpp b/runtime/event/event.cpp index 2a3e40b043..a14318b68a 100644 --- a/runtime/event/event.cpp +++ b/runtime/event/event.cpp @@ -634,12 +634,10 @@ void Event::executeCallbacks(int32_t executionStatusIn) { void Event::tryFlushEvent() { //only if event is not completed, completed event has already been flushed - if (cmdQueue && (updateStatusAndCheckCompletion() == false)) { + if (cmdQueue && updateStatusAndCheckCompletion() == false) { //flush the command queue only if it is not blocked event if (taskLevel != Event::eventNotReady) { - cl_event ev = this; - DBG_LOG(EventsDebugEnable, "tryFlushEvent", this); - cmdQueue->flushWaitList(1, &ev, this->getCommandType() == CL_COMMAND_NDRANGE_KERNEL); + cmdQueue->getDevice().getCommandStreamReceiver().flushBatchedSubmissions(); } } } diff --git a/unit_tests/command_queue/command_queue_flush_waitlist_tests.inl b/unit_tests/command_queue/command_queue_flush_waitlist_tests.inl index d782e0e2cb..e4a2c62846 100644 --- a/unit_tests/command_queue/command_queue_flush_waitlist_tests.inl +++ b/unit_tests/command_queue/command_queue_flush_waitlist_tests.inl @@ -52,33 +52,3 @@ struct CommandQueueSimpleTest DeviceFixture::TearDown(); } }; - -HWTEST_F(CommandQueueSimpleTest, flushWaitlistDoesNotFlushSingleEventWhenTaskCountIsAlreadySent) { - MockCommandQueue commandQueue(pContext, pDevice, 0); - - MockEvent event(&commandQueue, CL_COMMAND_NDRANGE_KERNEL, 1, 1); - cl_event clEvent = &event; - - auto &csr = pDevice->getUltCommandStreamReceiver(); - auto *gfxAllocation = pDevice->getMemoryManager()->allocateGraphicsMemory(4096); - IndirectHeap stream(gfxAllocation); - - // Update latestSentTaskCount to == 1 - DispatchFlags dispatchFlags; - dispatchFlags.blocking = true; - dispatchFlags.dcFlush = true; - - csr.flushTask(stream, 0, stream, stream, stream, 0, dispatchFlags, *pDevice); - - EXPECT_EQ(1u, csr.peekLatestSentTaskCount()); - csr.taskCount = 1; - // taskLevel less than event's level - csr.taskLevel = 0; - - commandQueue.flushWaitList(1, &clEvent, true); - - EXPECT_EQ(0u, csr.peekTaskLevel()); - EXPECT_EQ(1u, csr.peekTaskCount()); - - pDevice->getMemoryManager()->freeGraphicsMemory(gfxAllocation); -} diff --git a/unit_tests/command_queue/enqueue_thread_tests.inl b/unit_tests/command_queue/enqueue_thread_tests.inl index 9b56035b23..c690020a19 100644 --- a/unit_tests/command_queue/enqueue_thread_tests.inl +++ b/unit_tests/command_queue/enqueue_thread_tests.inl @@ -438,66 +438,4 @@ HWTEST_F(EnqueueThreading, finish) { pCmdQ->finish(false); } - -HWTEST_F(EnqueueThreading, flushWaitList) { - createCQ(); - auto csr = (CommandStreamReceiverMock *)&this->pDevice->getCommandStreamReceiver(); - csr->expectedToFreeCount = 0u; - pCmdQ->flushWaitList(0, nullptr, 0); -} - -HWTEST_F(EnqueueThreading, flushWaitList_ReleaseOwnershipWhenQueueIsBlocked) { - - class MyMockDevice : public MockDevice { - - public: - MyMockDevice() : MockDevice(*platformDevices[0]) {} - - bool takeOwnership(bool waitUntilGet) const override { - ++takeOwnershipCount; - Device::takeOwnership(true); - return true; - } - - void releaseOwnership() const override { - ++releaseOwnershipCount; - Device::releaseOwnership(); - } - - mutable uint32_t takeOwnershipCount = 0; - mutable uint32_t releaseOwnershipCount = 0; - }; - - class MockCommandQueue : public CommandQueue { - - public: - MockCommandQueue(MyMockDevice *device) : CommandQueue(nullptr, device, 0) { - this->myDevice = device; - } - - bool isQueueBlocked() override { - isQueueBlockedCount++; - return (isQueueBlockedCount < 5) ? true : false; - } - uint32_t isQueueBlockedCount = 0; - MyMockDevice *myDevice; - }; - - auto pMyDevice = new MyMockDevice(); - ASSERT_NE(nullptr, pMyDevice); - - auto pMyCmdQ = new MockCommandQueue(pMyDevice); - ASSERT_NE(nullptr, pMyCmdQ); - - EXPECT_TRUE(pMyCmdQ->isQueueBlocked()); - - pMyCmdQ->flushWaitList(0, nullptr, 0); - - EXPECT_EQ(pMyDevice->takeOwnershipCount, 0u); - EXPECT_EQ(pMyDevice->releaseOwnershipCount, 0u); - - delete pMyCmdQ; - - delete pMyDevice; -} } // namespace ULT