Append before setting last command to avoid corner case

Change-Id: Iafe5f899427f0119e7f43e96af38e6e3a1dbfc93


[ROCm/clr commit: 566144edb2]
Этот коммит содержится в:
Christophe Paquot
2020-02-13 15:46:14 -08:00
коммит произвёл Christophe Paquot
родитель 773abcec8b
Коммит a213e5d155
+2 -2
Просмотреть файл
@@ -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)) {