diff --git a/include/hip/hcc_detail/hip_runtime_api.h b/include/hip/hcc_detail/hip_runtime_api.h index f1614c8ed2..b011911a9d 100644 --- a/include/hip/hcc_detail/hip_runtime_api.h +++ b/include/hip/hcc_detail/hip_runtime_api.h @@ -2577,8 +2577,7 @@ hipError_t read_agent_global_from_module(hipDeviceptr_t* dptr, size_t* bytes, // hipModule_t instance static std::unordered_map< std::string, std::vector> agent_globals; - const char* hash = hash_for(hmod); - std::string key(hash); + std::string key(hash_for(hmod)); if (agent_globals.count(key) == 0) { static std::mutex mtx;