From d4a26f146887cd82c8e428f306475791ad873d61 Mon Sep 17 00:00:00 2001
From: foreman
Date: Fri, 23 Aug 2019 12:15:29 -0400
Subject: [PATCH] P4 to Git Change 1988234 by kjayapra@3_HIPWS_TXT_ROCM on
2019/08/23 12:12:45
SWDEV-201068 - Reverting back CL 1987582.
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/hip/hip_module.cpp#37 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#84 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.hpp#27 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/command.cpp#98 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/command.hpp#96 edit
[ROCm/clr commit: d9777f8524c49133c5d2f2416cb94e1cf9b3b4ee]
---
projects/clr/hipamd/api/hip/hip_module.cpp | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/projects/clr/hipamd/api/hip/hip_module.cpp b/projects/clr/hipamd/api/hip/hip_module.cpp
index f1659d496d..87106a73e6 100644
--- a/projects/clr/hipamd/api/hip/hip_module.cpp
+++ b/projects/clr/hipamd/api/hip/hip_module.cpp
@@ -253,6 +253,8 @@ hipError_t ihipModuleLaunchKernel(hipFunction_t f,
amd::NDRangeContainer ndrange(3, globalWorkOffset, globalWorkSize, localWorkSize);
amd::Command::EventWaitList waitList;
+ address kernargs = nullptr;
+
// 'extra' is a struct that contains the following info: {
// HIP_LAUNCH_PARAM_BUFFER_POINTER, kernargs,
// HIP_LAUNCH_PARAM_BUFFER_SIZE, &kernargs_size,
@@ -262,17 +264,19 @@ hipError_t ihipModuleLaunchKernel(hipFunction_t f,
extra[2] != HIP_LAUNCH_PARAM_BUFFER_SIZE || extra[4] != HIP_LAUNCH_PARAM_END) {
return hipErrorNotInitialized;
}
- address kernargs = reinterpret_cast(extra[1]);
- ::memcpy(kernel->parameters().values(), kernargs, *(size_t*)(extra[3]));
-// assert(kernel->signature().paramsSize()>=reinterpret_cast(extra[3]));
+ kernargs = reinterpret_cast(extra[1]);
}
- if (kernelParams != nullptr) {
const amd::KernelSignature& signature = kernel->signature();
for (size_t i = 0; i < signature.numParameters(); ++i) {
const amd::KernelParameterDescriptor& desc = signature.at(i);
+ if (kernelParams == nullptr) {
+ assert(kernargs != nullptr);
+ kernel->parameters().set(i, desc.size_, kernargs + desc.offset_,
+ desc.type_ == T_POINTER/*svmBound*/);
+ } else {
assert(extra == nullptr);
- kernel->parameters().set(i, desc.size_, kernelParams[i], desc.type_ == T_POINTER);
+ kernel->parameters().set(i, desc.size_, kernelParams[i], desc.type_ == T_POINTER/*svmBound*/);
}
}
@@ -283,7 +287,7 @@ hipError_t ihipModuleLaunchKernel(hipFunction_t f,
}
amd::NDRangeKernelCommand* command = new amd::NDRangeKernelCommand(
- *queue, waitList, *kernel, ndrange, sharedMemBytes, params, true);
+ *queue, waitList, *kernel, ndrange, sharedMemBytes, params);
if (!command) {
return hipErrorOutOfMemory;
}