From a213e5d155e0285e86bdbce98f19a0433bec648b Mon Sep 17 00:00:00 2001 From: Christophe Paquot Date: Thu, 13 Feb 2020 15:46:14 -0800 Subject: [PATCH] Append before setting last command to avoid corner case Change-Id: Iafe5f899427f0119e7f43e96af38e6e3a1dbfc93 [ROCm/clr commit: 566144edb21333e7a6abd68226a164378a376bbd] --- projects/clr/rocclr/platform/command.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/clr/rocclr/platform/command.cpp b/projects/clr/rocclr/platform/command.cpp index b6f496930a..522f95cd03 100644 --- a/projects/clr/rocclr/platform/command.cpp +++ b/projects/clr/rocclr/platform/command.cpp @@ -240,11 +240,11 @@ void Command::enqueue() { Agent::postEventCreate(as_cl(static_cast(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)) {