diff --git a/rocclr/platform/commandqueue.cpp b/rocclr/platform/commandqueue.cpp index c5fdad469f..358e79df73 100644 --- a/rocclr/platform/commandqueue.cpp +++ b/rocclr/platform/commandqueue.cpp @@ -54,6 +54,13 @@ HostQueue::HostQueue(Context& context, Device& device, cl_command_queue_properti bool HostQueue::terminate() { if (AMD_DIRECT_DISPATCH) { + Command* marker = new Marker(*this, true); + if (marker != nullptr) { + marker->enqueue(); + marker->awaitCompletion(); + marker->release(); + } + thread_.acceptingCommands_ = false; thread_.Release(); } else { if (Os::isThreadAlive(thread_)) {