From a5f13421b5e20706e7d662658a51c5a7d6f1f9ae Mon Sep 17 00:00:00 2001 From: Ben Sander Date: Sat, 17 Dec 2016 08:54:09 -0600 Subject: [PATCH] Add name for function [ROCm/hip commit: 90c69e14bb129617c6ec6e83c5cdba74645ac407] --- projects/hip/include/hip/hcc_detail/hip_runtime_api.h | 3 +-- projects/hip/src/hip_module.cpp | 10 ++++------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/projects/hip/include/hip/hcc_detail/hip_runtime_api.h b/projects/hip/include/hip/hcc_detail/hip_runtime_api.h index 0be4961f03..4c9cedecc4 100644 --- a/projects/hip/include/hip/hcc_detail/hip_runtime_api.h +++ b/projects/hip/include/hip/hcc_detail/hip_runtime_api.h @@ -30,7 +30,6 @@ THE SOFTWARE. #include #include -#include #include #include @@ -76,7 +75,7 @@ struct ihipModuleSymbol_t{ uint64_t _object; // The kernel object. uint32_t _groupSegmentSize; uint32_t _privateSegmentSize; - //std::string _name; // TODO - review for performance cost. Name is just used for debug. + char _name[64]; // TODO - review for performance cost. Name is just used for debug. }; typedef struct ihipModuleSymbol_t hipFunction_t; diff --git a/projects/hip/src/hip_module.cpp b/projects/hip/src/hip_module.cpp index 19de6957e5..74cdd8a4ae 100644 --- a/projects/hip/src/hip_module.cpp +++ b/projects/hip/src/hip_module.cpp @@ -243,7 +243,7 @@ hipError_t ihipModuleGetSymbol(hipFunction_t *func, hipModule_t hmod, const char &func->_privateSegmentSize); CHECK_HSA(status, hipErrorNotFound); - //func->_name = std::string(name); + strncpy(func->_name, name, sizeof(func->_name)); } return ihipLogStatus(ret); } @@ -297,9 +297,8 @@ hipError_t hipModuleLaunchKernel(hipFunction_t f, /* Kernel argument preparation. */ - grid_launch_parm lp; - //hStream = ihipPreLaunchKernel(hStream, 0, 0, &lp, f._name.empty() ? "ModuleKernel" : f._name.c_str()); - hStream = ihipPreLaunchKernel(hStream, 0, 0, &lp, "ModuleKernel"); + grid_launch_parm lp; // TODO - dummy arg but values are printed during debug. + hStream = ihipPreLaunchKernel(hStream, 0, 0, &lp, f._name); hsa_kernel_dispatch_packet_t aql; @@ -327,8 +326,7 @@ hipError_t hipModuleLaunchKernel(hipFunction_t f, lp.av->dispatch_hsa_kernel(&aql, config[1] /* kernarg*/, kernArgSize); - //ihipPostLaunchKernel(f._name.empty() ? "ModuleKernel" : f._name.c_str(), hStream, lp); - ihipPostLaunchKernel("ModuleKernel", hStream, lp); + ihipPostLaunchKernel(f._name, hStream, lp); } return ihipLogStatus(ret);