mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Remove redundant code from flushWaitList.
Change-Id: Iab4cb856ce324a785b052b8638ef23aef43c9bc9
This commit is contained in:

committed by
sys_ocldev

parent
d6b5433f14
commit
d563059c14
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
@ -2,4 +2,4 @@
|
||||
neoDependenciesRev='735095-769'
|
||||
strategy='EQUAL'
|
||||
allowedF=43
|
||||
allowedCD=345
|
||||
allowedCD=344
|
||||
|
@ -409,46 +409,7 @@ void CommandQueue::flushWaitList(
|
||||
while ((isQBlocked = isQueueBlocked()))
|
||||
;
|
||||
}
|
||||
|
||||
TakeOwnershipWrapper<Device> deviceOwnership(*device);
|
||||
device->getCommandStreamReceiver().flushBatchedSubmissions();
|
||||
|
||||
if (!isQBlocked) {
|
||||
auto taskLevel = getTaskLevelFromWaitList(this->taskLevel, numEventsInWaitList, eventWaitList);
|
||||
auto &commandStream = getCS();
|
||||
auto &commandStreamReceiver = device->getCommandStreamReceiver();
|
||||
|
||||
bool flushTask = false;
|
||||
|
||||
for (auto eventId = 0u; eventId < numEventsInWaitList; eventId++) {
|
||||
Event *event = (Event *)eventWaitList[eventId];
|
||||
if (event->peekTaskCount() > commandStreamReceiver.peekLatestSentTaskCount()) {
|
||||
flushTask = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (flushTask) {
|
||||
DispatchFlags dispatchFlags;
|
||||
dispatchFlags.GSBA32BitRequired = ndRangeKernel;
|
||||
dispatchFlags.lowPriority = priority == QueuePriority::LOW;
|
||||
dispatchFlags.throttle = throttle;
|
||||
dispatchFlags.implicitFlush = true;
|
||||
dispatchFlags.preemptionMode = PreemptionHelper::taskPreemptionMode(*device, nullptr);
|
||||
|
||||
DEBUG_BREAK_IF(taskLevel >= Event::eventNotReady);
|
||||
|
||||
commandStreamReceiver.flushTask(
|
||||
commandStream,
|
||||
commandStream.getUsed(),
|
||||
getIndirectHeap(IndirectHeap::DYNAMIC_STATE, 0),
|
||||
getIndirectHeap(IndirectHeap::INSTRUCTION, 0),
|
||||
getIndirectHeap(IndirectHeap::INDIRECT_OBJECT, 0),
|
||||
getIndirectHeap(IndirectHeap::SURFACE_STATE, 0),
|
||||
taskLevel + 1,
|
||||
dispatchFlags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool CommandQueue::setPerfCountersEnabled(bool perfCountersEnabled, cl_uint configuration) {
|
||||
|
@ -82,31 +82,3 @@ HWTEST_F(CommandQueueSimpleTest, flushWaitlistDoesNotFlushSingleEventWhenTaskCou
|
||||
|
||||
pDevice->getMemoryManager()->freeGraphicsMemory(gfxAllocation);
|
||||
}
|
||||
|
||||
TEST_F(CommandQueueSimpleTest, flushWaitlistFlushesSingleEventWhenTaskCountIsNotYetSent) {
|
||||
MockCommandQueue commandQueue(pContext, pDevice, 0);
|
||||
|
||||
// Event has 2 taskLevel and 2 taskCount
|
||||
MockEvent<Event> event(&commandQueue, CL_COMMAND_NDRANGE_KERNEL, 1, 2);
|
||||
cl_event clEvent = &event;
|
||||
|
||||
auto &csr = pDevice->getCommandStreamReceiver();
|
||||
auto *gfxAllocation = pDevice->getMemoryManager()->allocateGraphicsMemory(4096);
|
||||
LinearStream stream(gfxAllocation);
|
||||
|
||||
// Update latestSentTaskCount to == 1
|
||||
DispatchFlags dispatchFlags;
|
||||
dispatchFlags.blocking = true;
|
||||
dispatchFlags.dcFlush = true;
|
||||
|
||||
csr.flushTask(stream, 0, stream, stream, stream, stream, 0, dispatchFlags);
|
||||
|
||||
EXPECT_EQ(1u, csr.peekLatestSentTaskCount());
|
||||
|
||||
commandQueue.flushWaitList(1, &clEvent, true);
|
||||
|
||||
EXPECT_EQ(1u + 1u, csr.peekTaskLevel()); // event's plus one
|
||||
EXPECT_EQ(2u, csr.peekTaskCount());
|
||||
|
||||
pDevice->getMemoryManager()->freeGraphicsMemory(gfxAllocation);
|
||||
}
|
||||
|
@ -525,8 +525,8 @@ HWTEST_F(EnqueueThreading, flushWaitList_ReleaseOwnershipWhenQueueIsBlocked) {
|
||||
|
||||
pMyCmdQ->flushWaitList(0, nullptr, 0);
|
||||
|
||||
EXPECT_EQ(pMyDevice->takeOwnershipCount, 1u);
|
||||
EXPECT_EQ(pMyDevice->releaseOwnershipCount, 1u);
|
||||
EXPECT_EQ(pMyDevice->takeOwnershipCount, 0u);
|
||||
EXPECT_EQ(pMyDevice->releaseOwnershipCount, 0u);
|
||||
|
||||
delete pMyCmdQ;
|
||||
|
||||
|
@ -1229,20 +1229,6 @@ TEST_F(EventTest, GivenCL_SUBMITTEDWhenpeekIsSubmittedThenTrue) {
|
||||
EXPECT_EQ(true, executionStatus);
|
||||
}
|
||||
|
||||
TEST_F(EventTest, GivenNotCompletedEventWhenQueryingExecutionStatusAfterFlushThenCsrGetsFlushedWithProperTaskLevel) {
|
||||
cl_int ret;
|
||||
*pDevice->getTagAddress() = 2;
|
||||
Event ev(this->pCmdQ, CL_COMMAND_COPY_BUFFER, 3, 3);
|
||||
auto &csr = this->pCmdQ->getDevice().getCommandStreamReceiver();
|
||||
EXPECT_GT(3u, csr.peekTaskLevel());
|
||||
ret = clFlush(this->pCmdQ);
|
||||
ASSERT_EQ(CL_SUCCESS, ret);
|
||||
cl_int execState;
|
||||
ret = clGetEventInfo(&ev, CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(execState), &execState, nullptr);
|
||||
ASSERT_EQ(CL_SUCCESS, ret);
|
||||
EXPECT_EQ(4u, csr.peekTaskLevel());
|
||||
}
|
||||
|
||||
TEST_F(EventTest, GivenCompletedEventWhenQueryingExecutionStatusAfterFlushThenCsrIsNotFlushed) {
|
||||
cl_int ret;
|
||||
*pDevice->getTagAddress() = 3;
|
||||
|
Reference in New Issue
Block a user