Remove redundant code from flushWaitList.

Change-Id: Iab4cb856ce324a785b052b8638ef23aef43c9bc9
This commit is contained in:
Mrozek, Michal
2018-02-12 17:31:06 +01:00
committed by sys_ocldev
parent d6b5433f14
commit d563059c14
5 changed files with 4 additions and 85 deletions

2
Jenkinsfile vendored
View File

@ -2,4 +2,4 @@
neoDependenciesRev='735095-769'
strategy='EQUAL'
allowedF=43
allowedCD=345
allowedCD=344

View File

@ -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) {

View File

@ -81,32 +81,4 @@ HWTEST_F(CommandQueueSimpleTest, flushWaitlistDoesNotFlushSingleEventWhenTaskCou
EXPECT_EQ(1u, csr.peekTaskCount());
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);
}
}

View File

@ -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;

View File

@ -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;