From 2c045d12ee786cbace8311d7822c35cb469c8b9a Mon Sep 17 00:00:00 2001 From: Anusha GodavarthySurya Date: Mon, 12 Feb 2024 07:45:04 +0000 Subject: [PATCH] SWDEV-445013 - During CaptureAQLPackets correct sentinal value to copy integer size bytes Read and write int bytes sentinal value to dev_ptr or PCIE connected devices at the tail end of the kernarg surface. Change-Id: I993d552ac872b3cd56aef4746c4d1d92c58d38b4 [ROCm/clr commit: 853abeb75ed7ccefdc70444c97d7d55289c463b6] --- projects/clr/hipamd/src/hip_graph_internal.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/projects/clr/hipamd/src/hip_graph_internal.cpp b/projects/clr/hipamd/src/hip_graph_internal.cpp index f0f9e71ce5..eac63876f2 100644 --- a/projects/clr/hipamd/src/hip_graph_internal.cpp +++ b/projects/clr/hipamd/src/hip_graph_internal.cpp @@ -413,9 +413,9 @@ hipError_t GraphExec::CaptureAQLPackets() { // This needs to be done for PCIE connected devices only. HDP path is disabled for XGMI // between CPU<->GPU if (!device->isXgmi()) { - static int host_val = 1; + int host_val = 1; address dev_ptr = kernarg_pool_graph_ + kernarg_pool_size_graph_ - sizeof(int); - *dev_ptr = host_val; + *(reinterpret_cast(dev_ptr)) = host_val; if (device->info().hdpMemFlushCntl == nullptr) { amd::Command* command = new amd::Marker(*capture_stream_, true); if (command != nullptr) { @@ -425,8 +425,7 @@ hipError_t GraphExec::CaptureAQLPackets() { } else { *device->info().hdpMemFlushCntl = 1; } - while (*dev_ptr != host_val); - host_val++; + if (*(reinterpret_cast(dev_ptr)) != host_val); } } ResetQueueIndex();