From bc3e3217b6164590e4c0e4c150aa2cf5795340b1 Mon Sep 17 00:00:00 2001
From: foreman
Date: Mon, 13 Aug 2018 17:07:02 -0400
Subject: [PATCH] P4 to Git Change 1593119 by
skudchad@skudchad_test2_win_opencl on 2018/08/13 16:53:08
SWDEV-145570 - [HIP] Output Kernel name and mem arguments passed with LOG_LEVEL=3 for PAL and ROCm backends
ReviewBoardURL = http://ocltc.amd.com/reviews/r/15617/diff/
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#120 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#62 edit
---
rocclr/runtime/device/pal/palvirtual.cpp | 8 ++++++++
rocclr/runtime/device/rocm/rocvirtual.cpp | 6 +++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/rocclr/runtime/device/pal/palvirtual.cpp b/rocclr/runtime/device/pal/palvirtual.cpp
index 1c55b5049f..73af5e2fac 100644
--- a/rocclr/runtime/device/pal/palvirtual.cpp
+++ b/rocclr/runtime/device/pal/palvirtual.cpp
@@ -2167,6 +2167,9 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes, const
}
}
size_t ldsSize;
+
+ LogPrintfInfo("!\tShaderName : %s\n", hsaKernel.name().c_str());
+
// Check memory dependency and SVM objects
if (!processMemObjectsHSA(kernel, parameters, nativeMem, ldsSize)) {
LogError("Wrong memory objects!");
@@ -3138,6 +3141,11 @@ bool VirtualGPU::processMemObjectsHSA(const amd::Kernel& kernel, const_address p
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_,
+ globalAddress, (void*)gpuMem->vmAddress(),
+ (void*)((intptr_t)gpuMem->vmAddress() + gpuMem->size()));
+
//! Check if compiler expects read/write.
//! Note: SVM with subbuffers has an issue with tracking.
//! Conformance can send read only subbuffer, but update the region
diff --git a/rocclr/runtime/device/rocm/rocvirtual.cpp b/rocclr/runtime/device/rocm/rocvirtual.cpp
index 47b2f424d0..d35628a3f8 100644
--- a/rocclr/runtime/device/rocm/rocvirtual.cpp
+++ b/rocclr/runtime/device/rocm/rocvirtual.cpp
@@ -331,7 +331,9 @@ bool VirtualGPU::processMemObjects(const amd::Kernel& kernel, const_address para
// Synchronize data with other memory instances if necessary
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()));
// Validate memory for a dependency in the queue
memoryDependency().validate(*this, gpuMem, (desc.info_.readOnly_ == 1));
@@ -2062,6 +2064,8 @@ bool VirtualGPU::submitKernelInternal(const amd::NDRangeContainer& sizes, const
return false;
}
+ LogPrintfInfo("!\tShaderName : %s\n", gpuKernel.name().c_str());
+
// Check if runtime has to setup hidden arguments
for (uint32_t i = signature.numParameters(); i < signature.numParametersAll(); ++i) {
const auto it = signature.at(i);