SWDEV-264244 - Hide Notifications from HIP

This fixes hipStreamQuery returning hipErrorNotReady when idle
Change-Id: I3f77666a00bc6a7162b6c660d79e76c09669d94f
This commit is contained in:
Satyanvesh Dittakavi
2021-03-01 06:27:52 -05:00
parent dc58078887
commit a711a49881
3 changed files with 25 additions and 22 deletions
+16 -13
View File
@@ -200,21 +200,24 @@ void HostQueue::append(Command& command) {
if (!IS_HIP) {
return;
}
// 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;
}
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_);
if (prevLastEnqueueCommand != nullptr) {
prevLastEnqueueCommand->release();
prevLastEnqueueCommand = lastEnqueueCommand_;
lastEnqueueCommand_ = &command;
}
if (prevLastEnqueueCommand != nullptr) {
prevLastEnqueueCommand->release();
}
}
}