Skip to content

Commit c8ba97e

Browse files
Restore gpgpu csr's mutex lock in the enqueue blit
Signed-off-by: Lukasz Jobczyk <[email protected]>
1 parent b8d5fac commit c8ba97e

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

opencl/source/command_queue/enqueue_common.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,6 @@ template <typename GfxFamily>
10691069
template <uint32_t cmdType>
10701070
void 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

Comments
 (0)