diff --git a/hipamd/api/hip/hip_internal.hpp b/hipamd/api/hip/hip_internal.hpp index a44b5a0b5a..7e1b5e941c 100644 --- a/hipamd/api/hip/hip_internal.hpp +++ b/hipamd/api/hip/hip_internal.hpp @@ -124,10 +124,10 @@ struct ihipExec_t { }; class PlatformState { - amd::Monitor lock_; + amd::Monitor lock_{"Guards global function map"}; std::unordered_map>> modules_; - bool initialized_; + bool initialized_{false}; void digestFatBinary(const void* data, std::vector>& programs); public: @@ -181,7 +181,7 @@ private: static PlatformState* platform_; - PlatformState() : lock_("Guards global function map"), initialized_(false) {} + PlatformState() {} ~PlatformState() {} public: static PlatformState& instance() { diff --git a/hipamd/api/hip/hip_platform.cpp b/hipamd/api/hip/hip_platform.cpp index 6ce138e7a3..abb7cdb740 100644 --- a/hipamd/api/hip/hip_platform.cpp +++ b/hipamd/api/hip/hip_platform.cpp @@ -137,6 +137,10 @@ extern "C" std::vector>* __hipRegisterFatBinary(con void PlatformState::digestFatBinary(const void* data, std::vector>& programs) { + if (programs.size() > 0) { + return; + } + std::vector> code_objs; std::vector devices; for (size_t dev = 0; dev < g_devices.size(); ++dev) { @@ -164,6 +168,8 @@ void PlatformState::digestFatBinary(const void* data, std::vector