From cddec46bb7ebe23f00cc8a6b17d0db80c26a9013 Mon Sep 17 00:00:00 2001 From: kjayapra-amd Date: Tue, 11 Aug 2020 00:35:11 -0400 Subject: [PATCH] SWDEV-237658 - Do not attach events to user invisible Marker. Change-Id: I3a74fd2614d6e2e1d51543471bbd5ae51a713a47 [ROCm/clr commit: ea15c75c55d04793071163a2ec73280821d1606a] --- projects/clr/hipamd/rocclr/hip_event.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) mode change 100644 => 100755 projects/clr/hipamd/rocclr/hip_event.cpp diff --git a/projects/clr/hipamd/rocclr/hip_event.cpp b/projects/clr/hipamd/rocclr/hip_event.cpp old mode 100644 new mode 100755 index 858309d638..52775990be --- a/projects/clr/hipamd/rocclr/hip_event.cpp +++ b/projects/clr/hipamd/rocclr/hip_event.cpp @@ -143,7 +143,13 @@ void Event::addMarker(amd::HostQueue* queue, amd::Command* command, bool record) if (queue->properties().test(CL_QUEUE_PROFILING_ENABLE)) { if (command == nullptr) { command = queue->getLastQueuedCommand(true); - if (command == nullptr) { + if ((command == nullptr) || (command->type() == 0)) { + // if lastEnqueuedCommand is user invisible command(command->type() == 0), + // which is only used for sync, create a new amd:Marker + // and release() lastEnqueuedCommand + if (command != nullptr) { + command->release(); + } command = new amd::Marker(*queue, kMarkerDisableFlush); command->enqueue(); }