diff --git a/projects/rocprofiler/src/core/tracker.h b/projects/rocprofiler/src/core/tracker.h index ffc06b85ec..c4d619c9f3 100644 --- a/projects/rocprofiler/src/core/tracker.h +++ b/projects/rocprofiler/src/core/tracker.h @@ -83,7 +83,7 @@ class Tracker { static void Destroy() { std::lock_guard lck(glob_mutex_); - if (instance_ != NULL) delete instance_; + if (instance_ != NULL) delete instance_.load(); instance_ = NULL; } diff --git a/projects/rocprofiler/src/util/hsa_rsrc_factory.h b/projects/rocprofiler/src/util/hsa_rsrc_factory.h index f982ddde7b..af03189585 100644 --- a/projects/rocprofiler/src/util/hsa_rsrc_factory.h +++ b/projects/rocprofiler/src/util/hsa_rsrc_factory.h @@ -226,7 +226,7 @@ class HsaRsrcFactory { static void Destroy() { std::lock_guard lck(mutex_); - if (instance_) delete instance_; + if (instance_) delete instance_.load(); instance_ = NULL; } diff --git a/projects/rocprofiler/src/util/logger.h b/projects/rocprofiler/src/util/logger.h index 527589f64c..8c9cbfd3c4 100644 --- a/projects/rocprofiler/src/util/logger.h +++ b/projects/rocprofiler/src/util/logger.h @@ -90,7 +90,7 @@ class Logger { static void Destroy() { std::lock_guard lck(mutex_); - if (instance_ != NULL) delete instance_; + if (instance_ != NULL) delete instance_.load(); instance_ = NULL; } diff --git a/projects/rocprofiler/test/app/test.cpp b/projects/rocprofiler/test/app/test.cpp index 796ba1eb1d..5406797300 100644 --- a/projects/rocprofiler/test/app/test.cpp +++ b/projects/rocprofiler/test/app/test.cpp @@ -73,7 +73,7 @@ int main(int argc, char** argv) { TestHsa::HsaInstantiate(); - std::thread t[thrs]; + std::vector t(thrs); for (int n = 0; n < thrs; ++n) { t[n] = std::thread(thread_fun, kiter, diter, agents_number); } diff --git a/projects/rocprofiler/test/ctrl/test_hsa.cpp b/projects/rocprofiler/test/ctrl/test_hsa.cpp index d006d19c4e..3cb5dee7e6 100644 --- a/projects/rocprofiler/test/ctrl/test_hsa.cpp +++ b/projects/rocprofiler/test/ctrl/test_hsa.cpp @@ -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; diff --git a/projects/rocprofiler/test/tool/tool.cpp b/projects/rocprofiler/test/tool/tool.cpp index 3ecef03d4d..877fd5b984 100644 --- a/projects/rocprofiler/test/tool/tool.cpp +++ b/projects/rocprofiler/test/tool/tool.cpp @@ -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 diff --git a/projects/rocprofiler/test/util/hsa_rsrc_factory.h b/projects/rocprofiler/test/util/hsa_rsrc_factory.h index 552789cc06..9c0207e26b 100644 --- a/projects/rocprofiler/test/util/hsa_rsrc_factory.h +++ b/projects/rocprofiler/test/util/hsa_rsrc_factory.h @@ -220,7 +220,7 @@ class HsaRsrcFactory { static void Destroy() { std::lock_guard lck(mutex_); - if (instance_) delete instance_; + if (instance_) delete instance_.load(); instance_ = NULL; }