Use Semaphore to wait for dependencies from different device

Change-Id: I154f377c77847e93d5b188a5b2252e74d9d70b75
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2018-09-07 14:31:37 +02:00
parent 2315403542
commit 24136414e6
6 changed files with 116 additions and 0 deletions

View File

@@ -347,6 +347,8 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface **surfacesForResidency,
auto submissionRequired = isCommandWithoutKernel(commandType) ? false : true;
if (submissionRequired) {
EventsRequest eventsRequest(numEventsInWaitList, eventWaitList, nullptr);
completionStamp = enqueueNonBlocked<commandType>(
surfacesForResidency,
numSurfaceForResidency,
@@ -354,6 +356,7 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface **surfacesForResidency,
commandStreamStart,
blocking,
multiDispatchInfo,
eventsRequest,
eventBuilder,
taskLevel,
slmUsed,
@@ -507,6 +510,7 @@ CompletionStamp CommandQueueHw<GfxFamily>::enqueueNonBlocked(
size_t commandStreamStart,
bool &blocking,
const MultiDispatchInfo &multiDispatchInfo,
EventsRequest &eventsRequest,
EventBuilder &eventBuilder,
uint32_t taskLevel,
bool slmUsed,
@@ -588,6 +592,9 @@ CompletionStamp CommandQueueHw<GfxFamily>::enqueueNonBlocked(
dispatchFlags.flushStampReference = this->flushStamp->getStampReference();
dispatchFlags.preemptionMode = PreemptionHelper::taskPreemptionMode(*device, multiDispatchInfo);
dispatchFlags.outOfOrderExecutionAllowed = !eventBuilder.getEvent() || commandStreamReceiver.isNTo1SubmissionModelEnabled();
if (commandStreamReceiver.peekTimestampPacketWriteEnabled()) {
dispatchFlags.outOfDeviceDependencies = &eventsRequest;
}
DEBUG_BREAK_IF(taskLevel >= Event::eventNotReady);