From de5168fdefbb4d5951b8b7a51f512685c063d145 Mon Sep 17 00:00:00 2001 From: anusha GodavarthySurya Date: Mon, 26 Jul 2021 14:26:32 -0700 Subject: [PATCH] SWDEV-295251 - Remove waitEvent check in append Change-Id: I994f3e7c67ed29c4ee46229c8bcd1448fc7f59ec --- rocclr/platform/commandqueue.cpp | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/rocclr/platform/commandqueue.cpp b/rocclr/platform/commandqueue.cpp index 4de1a0aca2..2cc44abb3c 100644 --- a/rocclr/platform/commandqueue.cpp +++ b/rocclr/platform/commandqueue.cpp @@ -221,23 +221,21 @@ void HostQueue::append(Command& command) { return; } - if (command.waitingEvent() == nullptr) { - // Set last submitted command - Command* prevLastEnqueueCommand; - command.retain(); - { - // lastCmdLock_ ensures that lastEnqueueCommand() can retain the command before it is swapped - // out. We want to keep this critical section as short as possible, so the command should be - // released outside this section. - ScopedLock l(lastCmdLock_); + // Set last submitted command + Command* prevLastEnqueueCommand; + command.retain(); + { + // lastCmdLock_ ensures that lastEnqueueCommand() can retain the command before it is swapped + // out. We want to keep this critical section as short as possible, so the command should be + // released outside this section. + ScopedLock l(lastCmdLock_); - prevLastEnqueueCommand = lastEnqueueCommand_; - lastEnqueueCommand_ = &command; - } + prevLastEnqueueCommand = lastEnqueueCommand_; + lastEnqueueCommand_ = &command; + } - if (prevLastEnqueueCommand != nullptr) { - prevLastEnqueueCommand->release(); - } + if (prevLastEnqueueCommand != nullptr) { + prevLastEnqueueCommand->release(); } }