From cf0504da19f0450e8d106f580fdd6a77572dd2e4 Mon Sep 17 00:00:00 2001 From: foreman Date: Fri, 24 Aug 2018 14:21:35 -0400 Subject: [PATCH] P4 to Git Change 1598045 by skudchad@skudchad_test2_win_opencl on 2018/08/24 14:07:44 SWDEV-145570 - [HIP] Output threadID along with kernel info with LOG_LEVEL=3 ReviewBoardURL = http://ocltc.amd.com/reviews/r/15684/diff/ Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#121 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#65 edit --- rocclr/runtime/device/pal/palvirtual.cpp | 6 +++--- rocclr/runtime/device/rocm/rocvirtual.cpp | 7 +++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/rocclr/runtime/device/pal/palvirtual.cpp b/rocclr/runtime/device/pal/palvirtual.cpp index 73af5e2fac..e97fb32f04 100644 --- a/rocclr/runtime/device/pal/palvirtual.cpp +++ b/rocclr/runtime/device/pal/palvirtual.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include "palQueue.h" #include "palFence.h" @@ -3140,11 +3141,10 @@ bool VirtualGPU::processMemObjectsHSA(const amd::Kernel& kernel, const_address p gpuMem->wait(*this, WaitOnBusyEngine); addVmMemory(gpuMem); - void* globalAddress = *(void**)(const_cast
(params) + desc.offset_); - LogPrintfInfo("!\targ%d: %s %s = ptr:%p obj:[%p-%p]\n", index, desc.typeName_, desc.name_, + LogPrintfInfo("!\targ%d: %s %s = ptr:%p obj:[%p-%p] threadId : %zx\n", index, desc.typeName_, desc.name_, globalAddress, (void*)gpuMem->vmAddress(), - (void*)((intptr_t)gpuMem->vmAddress() + gpuMem->size())); + (void*)((intptr_t)gpuMem->vmAddress() + gpuMem->size()), std::this_thread::get_id()); //! Check if compiler expects read/write. //! Note: SVM with subbuffers has an issue with tracking. diff --git a/rocclr/runtime/device/rocm/rocvirtual.cpp b/rocclr/runtime/device/rocm/rocvirtual.cpp index 9525cfc6fe..f45e9bed4e 100644 --- a/rocclr/runtime/device/rocm/rocvirtual.cpp +++ b/rocclr/runtime/device/rocm/rocvirtual.cpp @@ -21,6 +21,7 @@ #include #include #include +#include /** * HSA image object size in bytes (see HSAIL spec) @@ -332,8 +333,10 @@ bool VirtualGPU::processMemObjects(const amd::Kernel& kernel, const_address para gpuMem->syncCacheFromHost(*this); } void* globalAddress = *(void**)(const_cast
(params) + desc.offset_); - LogPrintfInfo("!\targ%d: %s %s = ptr:%p obj:[%p-%p]\n", index, desc.typeName_, desc.name_, - globalAddress, gpuMem->getDeviceMemory(), (void*)((intptr_t)gpuMem->getDeviceMemory() + mem->getSize())); + LogPrintfInfo("!\targ%d: %s %s = ptr:%p obj:[%p-%p] threadId : %zx\n", index, desc.typeName_, + desc.name_, globalAddress, gpuMem->getDeviceMemory(), + (void*)((intptr_t)gpuMem->getDeviceMemory() + mem->getSize()), + std::this_thread::get_id()); // Validate memory for a dependency in the queue memoryDependency().validate(*this, gpuMem, (desc.info_.readOnly_ == 1));