From 6d3939cd49dd092915cad0afa971e1769168673f Mon Sep 17 00:00:00 2001 From: Laurent Morichetti Date: Fri, 30 Sep 2022 21:42:07 -0700 Subject: [PATCH] SWDEV-351980 - Store the correlation ID in the dispatch packet The profiler can retrieve this correlation ID to attribute waves to specific dispatch locations. Change-Id: I700e8a91219d612f6a2028c0dda0c92753f3526a [ROCm/clr commit: b043b4f5a25158f86c75c66c95883712c5224983] --- projects/clr/rocclr/device/rocm/rocvirtual.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/projects/clr/rocclr/device/rocm/rocvirtual.cpp b/projects/clr/rocclr/device/rocm/rocvirtual.cpp index 0f203c3492..c055da80a3 100644 --- a/projects/clr/rocclr/device/rocm/rocvirtual.cpp +++ b/projects/clr/rocclr/device/rocm/rocvirtual.cpp @@ -3021,6 +3021,12 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes, addSystemScope_ = false; } + // 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 (vcmd != nullptr && vcmd->profilingInfo().enabled_) { + dispatchPacket.reserved2 = vcmd->profilingInfo().correlation_id_; + } + // Dispatch the packet if (!dispatchAqlPacket( &dispatchPacket, aqlHeaderWithOrder,