From fac2a9fbc845c1da9e9b165ff9387f5cfe366faa Mon Sep 17 00:00:00 2001 From: Saleel Kudchadker Date: Wed, 12 May 2021 13:40:43 -0700 Subject: [PATCH] SWDEV-283726 - Indicate profiler attached Set profiler attached flag in VirtualGPU to inform ROCclr of it Change-Id: I776c9fcd762cf02f3ce0f3c386d02384a224126c --- rocclr/hip_stream.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rocclr/hip_stream.cpp b/rocclr/hip_stream.cpp index e265b376c2..c490fd0fe9 100755 --- a/rocclr/hip_stream.cpp +++ b/rocclr/hip_stream.cpp @@ -77,8 +77,8 @@ bool Stream::Create() { // Enable queue profiling if a profiler is attached which sets the callback_table flag // or if we force it with env var. This would enable time stamp collection for every // command submitted to the stream(queue). - cl_command_queue_properties properties = (callbacks_table.is_enabled() || - HIP_FORCE_QUEUE_PROFILING) ? + bool isProfilerAttached = callbacks_table.is_enabled(); + cl_command_queue_properties properties = (isProfilerAttached || HIP_FORCE_QUEUE_PROFILING) ? CL_QUEUE_PROFILING_ENABLE : 0; amd::CommandQueue::Priority p; switch (priority_) { @@ -104,6 +104,7 @@ bool Stream::Create() { amd::ScopedLock lock(streamSetLock); streamSet.insert(this); queue_ = queue; + queue->vdev()->profilerAttach(isProfilerAttached); } else if (queue != nullptr) { queue->release(); }