diff --git a/rocclr/device/rocm/rocvirtual.cpp b/rocclr/device/rocm/rocvirtual.cpp index 42eb546eab..5abbb6c280 100644 --- a/rocclr/device/rocm/rocvirtual.cpp +++ b/rocclr/device/rocm/rocvirtual.cpp @@ -865,7 +865,8 @@ bool VirtualGPU::dispatchGenericAqlPacket( // If profiling is enabled, store the correlation ID in the dispatch packet. The profiler can // retrieve this correlation ID to attribute waves to specific dispatch locations. - if (std::is_same::value) { + if (std::is_same::value && + activity_prof::IsEnabled(OP_ID_DISPATCH)) { auto dispatchPacket = reinterpret_cast(packet); dispatchPacket->reserved2 = timestamp_->command().profilingInfo().correlation_id_; } diff --git a/rocclr/platform/command.cpp b/rocclr/platform/command.cpp index 052b1f09e5..7e078c9a68 100644 --- a/rocclr/platform/command.cpp +++ b/rocclr/platform/command.cpp @@ -158,7 +158,9 @@ bool Event::setStatus(int32_t status, uint64_t timeStamp) { releaseResources(); } - if (profilingInfo().enabled_) activity_prof::ReportActivity(command()); + if (profilingInfo().enabled_ && activity_prof::IsEnabled(OP_ID_DISPATCH)) { + activity_prof::ReportActivity(command()); + } // Broadcast all the waiters. if (referenceCount() > 1) { diff --git a/rocclr/platform/command.hpp b/rocclr/platform/command.hpp index 854be3f2b6..cbd837a2d6 100644 --- a/rocclr/platform/command.hpp +++ b/rocclr/platform/command.hpp @@ -126,6 +126,7 @@ class Event : public RuntimeObject { submitted_ = 0ULL; start_ = 0ULL; end_ = 0ULL; + correlation_id_ = 0ULL; } } profilingInfo_;