From 52e3652f926ccfd29d5909c374c474d6a17958c1 Mon Sep 17 00:00:00 2001
From: foreman
Date: Wed, 31 Aug 2016 20:21:06 -0400
Subject: [PATCH] P4 to Git Change 1309479 by lmoriche@lmoriche_opencl_dev on
2016/08/31 20:14:13
SWDEV-94610 - Fix the argName length issue. The string returned by the ROCR is already NUL-terminated.
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.cpp#22 edit
---
rocclr/runtime/device/rocm/rocprogram.cpp | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/rocclr/runtime/device/rocm/rocprogram.cpp b/rocclr/runtime/device/rocm/rocprogram.cpp
index 7993a07adb..70680de913 100644
--- a/rocclr/runtime/device/rocm/rocprogram.cpp
+++ b/rocclr/runtime/device/rocm/rocprogram.cpp
@@ -63,13 +63,11 @@ namespace roc {
uint32_t len;
hsa_executable_symbol_get_info(symbol, HSA_EXECUTABLE_SYMBOL_INFO_NAME_LENGTH, &len);
- char* symName = (char*) malloc(len);
+ char* symName = (char*) alloca(len);
hsa_executable_symbol_get_info(symbol, HSA_EXECUTABLE_SYMBOL_INFO_NAME, symName);
- std::string kernelName(symName,len);
+ std::string kernelName(symName);
symNameList->push_back(kernelName);
-
- free(symName);
}
return HSA_STATUS_SUCCESS;
@@ -1103,11 +1101,6 @@ namespace roc {
// for OpenCL default hidden kernel arguments assuming there is no printf
size_t numHiddenKernelArgs = 3; // FIXME_Wilkin
- // Fix the kernel name issue that causes string comparison does not work
- // due to an extra character at the end
- // TODO: find out the root cause
- kernelName.resize(kernelName.length()-1);
-
Kernel *aKernel = new roc::Kernel(
kernelName,
this,