Append before setting last command to avoid corner case

Change-Id: Iafe5f899427f0119e7f43e96af38e6e3a1dbfc93
This commit is contained in:
Christophe Paquot
2020-02-13 15:46:14 -08:00
committed by Christophe Paquot
parent 7fb53890b8
commit 566144edb2
+2 -2
View File
@@ -240,11 +240,11 @@ void Command::enqueue() {
Agent::postEventCreate(as_cl(static_cast<Event*>(this)), type_);
}
ClPrint(LOG_DEBUG, LOG_CMD, "command is enqueued: %p", this);
queue_->append(*this);
if (IS_HIP) {
queue_->setLastQueuedCommand(this);
}
ClPrint(LOG_DEBUG, LOG_CMD, "command is enqueued: %p", this);
queue_->append(*this);
queue_->flush();
if ((queue_->device().settings().waitCommand_ && (type_ != 0)) ||
((commandWaitBits_ & 0x2) != 0)) {