build: slightly change files to pass compilation
Compiled using Clang and encountered errors on ambiguous pointer
type, implicit conversion NULL to bool, and unused function, etc.
As a fix, this patch slightly updates the related codes.
Change-Id: I4a73d66293313dda36749036f5c73aaf2a445231
[ROCm/rocprofiler commit: ee917344ff]
Αυτή η υποβολή περιλαμβάνεται σε:
@@ -83,7 +83,7 @@ class Tracker {
|
||||
|
||||
static void Destroy() {
|
||||
std::lock_guard<mutex_t> lck(glob_mutex_);
|
||||
if (instance_ != NULL) delete instance_;
|
||||
if (instance_ != NULL) delete instance_.load();
|
||||
instance_ = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ class HsaRsrcFactory {
|
||||
|
||||
static void Destroy() {
|
||||
std::lock_guard<mutex_t> lck(mutex_);
|
||||
if (instance_) delete instance_;
|
||||
if (instance_) delete instance_.load();
|
||||
instance_ = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ class Logger {
|
||||
|
||||
static void Destroy() {
|
||||
std::lock_guard<mutex_t> lck(mutex_);
|
||||
if (instance_ != NULL) delete instance_;
|
||||
if (instance_ != NULL) delete instance_.load();
|
||||
instance_ = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ int main(int argc, char** argv) {
|
||||
|
||||
TestHsa::HsaInstantiate();
|
||||
|
||||
std::thread t[thrs];
|
||||
std::vector<std::thread> t(thrs);
|
||||
for (int n = 0; n < thrs; ++n) {
|
||||
t[n] = std::thread(thread_fun, kiter, diter, agents_number);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ bool TestHsa::Initialize(int /*arg_cnt*/, char** /*arg_list*/) {
|
||||
if (!hsa_rsrc_->GetGpuAgentInfo(agent_id, &agent_info_)) {
|
||||
agent_info_ = NULL;
|
||||
std::cerr << "> error: agent[" << agent_id << "] is not found" << std::endl;
|
||||
return NULL;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
std::clog << "> Using agent[" << agent_info_->dev_index << "] : " << agent_info_->name << std::endl;
|
||||
|
||||
@@ -139,7 +139,6 @@ bool is_trace_local = true;
|
||||
// SPM trace enabled
|
||||
bool is_spm_trace = false;
|
||||
|
||||
static inline uint32_t GetPid() { return syscall(__NR_getpid); }
|
||||
static inline uint32_t GetTid() { return syscall(__NR_gettid); }
|
||||
|
||||
// Error handler
|
||||
|
||||
@@ -220,7 +220,7 @@ class HsaRsrcFactory {
|
||||
|
||||
static void Destroy() {
|
||||
std::lock_guard<mutex_t> lck(mutex_);
|
||||
if (instance_) delete instance_;
|
||||
if (instance_) delete instance_.load();
|
||||
instance_ = NULL;
|
||||
}
|
||||
|
||||
|
||||
Αναφορά σε νέο ζήτημα
Block a user