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
This commit is contained in:
foreman
2016-08-31 20:21:06 -04:00
parent 29a3f5d56a
commit 52e3652f92
+2 -9
View File
@@ -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,