diff --git a/hipamd/src/hip_prof_api.h b/hipamd/src/hip_prof_api.h index c5d075a68e..c06ffdcd23 100644 --- a/hipamd/src/hip_prof_api.h +++ b/hipamd/src/hip_prof_api.h @@ -56,8 +56,8 @@ class api_callbacks_table_t { // HIP API callbacks table struct hip_cb_table_entry_t { - volatile std::atomic sync; - volatile std::atomic sem; + volatile std::atomic sync{false}; + volatile std::atomic sem{0}; act_t act; void* a_arg; fun_t fun; @@ -65,12 +65,10 @@ class api_callbacks_table_t { }; struct hip_cb_table_t { - hip_cb_table_entry_t arr[HIP_API_ID_NUMBER]; + hip_cb_table_entry_t arr[HIP_API_ID_NUMBER] = {}; }; - api_callbacks_table_t() { - memset(&callbacks_table_, 0, sizeof(callbacks_table_)); - } + api_callbacks_table_t() = default; bool set_activity(uint32_t id, act_t fun, void* arg) { std::lock_guard lock(mutex_);