From c8ba97e492b2b6cf6565e797ef0e31859baac590 Mon Sep 17 00:00:00 2001 From: Lukasz Jobczyk Date: Thu, 10 Mar 2022 12:17:28 +0000 Subject: [PATCH] Restore gpgpu csr's mutex lock in the enqueue blit Signed-off-by: Lukasz Jobczyk --- opencl/source/command_queue/enqueue_common.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/opencl/source/command_queue/enqueue_common.h b/opencl/source/command_queue/enqueue_common.h index 902a3623c4..62adace52e 100644 --- a/opencl/source/command_queue/enqueue_common.h +++ b/opencl/source/command_queue/enqueue_common.h @@ -1069,7 +1069,6 @@ template template void CommandQueueHw::enqueueBlit(const MultiDispatchInfo &multiDispatchInfo, cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_event *event, bool blocking, CommandStreamReceiver &bcsCsr) { auto bcsCommandStreamReceiverOwnership = bcsCsr.obtainUniqueOwnership(); - std::unique_lock commandStreamReceiverOwnership; EventsRequest eventsRequest(numEventsInWaitList, eventWaitList, event); EventBuilder eventBuilder; @@ -1079,6 +1078,7 @@ void CommandQueueHw::enqueueBlit(const MultiDispatchInfo &multiDispat std::unique_ptr blockedCommandsData; TakeOwnershipWrapper> queueOwnership(*this); + auto commandStreamReceiverOwnership = getGpgpuCommandStreamReceiver().obtainUniqueOwnership(); auto blockQueue = false; auto taskLevel = 0u; @@ -1127,7 +1127,6 @@ void CommandQueueHw::enqueueBlit(const MultiDispatchInfo &multiDispat LinearStream *gpgpuCommandStream = {}; size_t gpgpuCommandStreamStart = {}; if (gpgpuSubmission) { - commandStreamReceiverOwnership = getGpgpuCommandStreamReceiver().obtainUniqueOwnership(); gpgpuCommandStream = obtainCommandStream(csrDeps, true, blockQueue, multiDispatchInfo, eventsRequest, blockedCommandsData, nullptr, 0, false); gpgpuCommandStreamStart = gpgpuCommandStream->getUsed(); } @@ -1139,10 +1138,6 @@ void CommandQueueHw::enqueueBlit(const MultiDispatchInfo &multiDispat completionStamp = enqueueCommandWithoutKernel(nullptr, 0, gpgpuCommandStream, gpgpuCommandStreamStart, blocking, enqueueProperties, timestampPacketDependencies, eventsRequest, eventBuilder, taskLevel, csrDeps, &bcsCsr); - if (gpgpuSubmission) { - commandStreamReceiverOwnership.unlock(); - } - if (eventBuilder.getEvent()) { eventBuilder.getEvent()->flushStamp->replaceStampObject(this->flushStamp->getStampReference()); } @@ -1155,14 +1150,11 @@ void CommandQueueHw::enqueueBlit(const MultiDispatchInfo &multiDispat if (blockQueue) { enqueueBlocked(cmdType, nullptr, 0, multiDispatchInfo, timestampPacketDependencies, blockedCommandsData, enqueueProperties, eventsRequest, eventBuilder, nullptr, &bcsCsr); - - if (gpgpuSubmission) { - commandStreamReceiverOwnership.unlock(); - } } timestampPacketDependencies.moveNodesToNewContainer(*deferredTimestampPackets); + commandStreamReceiverOwnership.unlock(); queueOwnership.unlock(); bcsCommandStreamReceiverOwnership.unlock();