SWDEV-281658 - Fix compilation warnings
In file included from /extra/lmoriche/hip-vdi/hip/rocclr/hip_internal.hpp:25,
from /extra/lmoriche/hip-vdi/hip/rocclr/hip_hmm.cpp:22:
/extra/lmoriche/hip-vdi/hip/rocclr/hip_prof_api.h: In constructor ‘api_callbacks_table_t::api_callbacks_table_t()’:
/extra/lmoriche/hip-vdi/hip/rocclr/hip_prof_api.h:72:59: warning: ‘void* memset(void*, int, size_t)’ clearing an object of type ‘struct api_callbacks_table_t::hip_cb_table_t’ with no trivial copy-assignment; use value-initialization instead [-Wclass-memaccess]
72 | memset(&callbacks_table_, 0, sizeof(callbacks_table_));
| ^
/extra/lmoriche/hip-vdi/hip/rocclr/hip_prof_api.h:67:10: note: ‘struct api_callbacks_table_t::hip_cb_table_t’ declared here
67 | struct hip_cb_table_t {
| ^~~~~~~~~~~~~~
Address the above warning by providing default initialization of the
api_callbacks_table_t::hip_cb_table_t class members.
Change-Id: I69ea7c390c28cf3f8aec57f23566d6a3061a0365
Αυτή η υποβολή περιλαμβάνεται σε:
@@ -56,8 +56,8 @@ class api_callbacks_table_t {
|
|||||||
|
|
||||||
// HIP API callbacks table
|
// HIP API callbacks table
|
||||||
struct hip_cb_table_entry_t {
|
struct hip_cb_table_entry_t {
|
||||||
volatile std::atomic<bool> sync;
|
volatile std::atomic<bool> sync{false};
|
||||||
volatile std::atomic<uint32_t> sem;
|
volatile std::atomic<uint32_t> sem{0};
|
||||||
act_t act;
|
act_t act;
|
||||||
void* a_arg;
|
void* a_arg;
|
||||||
fun_t fun;
|
fun_t fun;
|
||||||
@@ -65,12 +65,10 @@ class api_callbacks_table_t {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct hip_cb_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() {
|
api_callbacks_table_t() = default;
|
||||||
memset(&callbacks_table_, 0, sizeof(callbacks_table_));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool set_activity(uint32_t id, act_t fun, void* arg) {
|
bool set_activity(uint32_t id, act_t fun, void* arg) {
|
||||||
std::lock_guard<mutex_t> lock(mutex_);
|
std::lock_guard<mutex_t> lock(mutex_);
|
||||||
|
|||||||
Αναφορά σε νέο ζήτημα
Block a user