@@ -1069,7 +1069,6 @@ template <typename GfxFamily>
10691069template <uint32_t cmdType>
10701070void CommandQueueHw<GfxFamily>::enqueueBlit(const MultiDispatchInfo &multiDispatchInfo, cl_uint numEventsInWaitList, const cl_event *eventWaitList, cl_event *event, bool blocking, CommandStreamReceiver &bcsCsr) {
10711071 auto bcsCommandStreamReceiverOwnership = bcsCsr.obtainUniqueOwnership ();
1072- std::unique_lock<NEO::CommandStreamReceiver::MutexType> commandStreamReceiverOwnership;
10731072
10741073 EventsRequest eventsRequest (numEventsInWaitList, eventWaitList, event);
10751074 EventBuilder eventBuilder;
@@ -1079,6 +1078,7 @@ void CommandQueueHw<GfxFamily>::enqueueBlit(const MultiDispatchInfo &multiDispat
10791078
10801079 std::unique_ptr<KernelOperation> blockedCommandsData;
10811080 TakeOwnershipWrapper<CommandQueueHw<GfxFamily>> queueOwnership (*this );
1081+ auto commandStreamReceiverOwnership = getGpgpuCommandStreamReceiver ().obtainUniqueOwnership ();
10821082
10831083 auto blockQueue = false ;
10841084 auto taskLevel = 0u ;
@@ -1127,7 +1127,6 @@ void CommandQueueHw<GfxFamily>::enqueueBlit(const MultiDispatchInfo &multiDispat
11271127 LinearStream *gpgpuCommandStream = {};
11281128 size_t gpgpuCommandStreamStart = {};
11291129 if (gpgpuSubmission) {
1130- commandStreamReceiverOwnership = getGpgpuCommandStreamReceiver ().obtainUniqueOwnership ();
11311130 gpgpuCommandStream = obtainCommandStream<cmdType>(csrDeps, true , blockQueue, multiDispatchInfo, eventsRequest, blockedCommandsData, nullptr , 0 , false );
11321131 gpgpuCommandStreamStart = gpgpuCommandStream->getUsed ();
11331132 }
@@ -1139,10 +1138,6 @@ void CommandQueueHw<GfxFamily>::enqueueBlit(const MultiDispatchInfo &multiDispat
11391138 completionStamp = enqueueCommandWithoutKernel (nullptr , 0 , gpgpuCommandStream, gpgpuCommandStreamStart, blocking,
11401139 enqueueProperties, timestampPacketDependencies, eventsRequest,
11411140 eventBuilder, taskLevel, csrDeps, &bcsCsr);
1142- if (gpgpuSubmission) {
1143- commandStreamReceiverOwnership.unlock ();
1144- }
1145-
11461141 if (eventBuilder.getEvent ()) {
11471142 eventBuilder.getEvent ()->flushStamp ->replaceStampObject (this ->flushStamp ->getStampReference ());
11481143 }
@@ -1155,14 +1150,11 @@ void CommandQueueHw<GfxFamily>::enqueueBlit(const MultiDispatchInfo &multiDispat
11551150
11561151 if (blockQueue) {
11571152 enqueueBlocked (cmdType, nullptr , 0 , multiDispatchInfo, timestampPacketDependencies, blockedCommandsData, enqueueProperties, eventsRequest, eventBuilder, nullptr , &bcsCsr);
1158-
1159- if (gpgpuSubmission) {
1160- commandStreamReceiverOwnership.unlock ();
1161- }
11621153 }
11631154
11641155 timestampPacketDependencies.moveNodesToNewContainer (*deferredTimestampPackets);
11651156
1157+ commandStreamReceiverOwnership.unlock ();
11661158 queueOwnership.unlock ();
11671159 bcsCommandStreamReceiverOwnership.unlock ();
11681160
0 commit comments