diff --git a/src/core/rocprofiler.cpp b/src/core/rocprofiler.cpp index b50bd51d..9b9cc5dd 100644 --- a/src/core/rocprofiler.cpp +++ b/src/core/rocprofiler.cpp @@ -111,7 +111,7 @@ decltype(hsa_executable_destroy)* hsa_executable_destroy_fn; ::HsaApiTable* kHsaApiTable; void SaveHsaApi(::HsaApiTable* table) { - util::HsaRsrcFactory::InitHsaApiTable(table); + util::HsaRsrcFactory::Instance().InitHsaApiTable(table); kHsaApiTable = table; hsa_queue_create_fn = table->core_->hsa_queue_create_fn; diff --git a/src/util/hsa_rsrc_factory.cpp b/src/util/hsa_rsrc_factory.cpp index 9d980312..d5fb5634 100644 --- a/src/util/hsa_rsrc_factory.cpp +++ b/src/util/hsa_rsrc_factory.cpp @@ -184,7 +184,6 @@ HsaRsrcFactory::~HsaRsrcFactory() { void HsaRsrcFactory::InitHsaApiTable(HsaApiTable* table) { std::lock_guard lck(mutex_); - if (hsa_api_.hsa_init == NULL) { if (table != NULL) { hsa_api_.hsa_init = table->core_->hsa_init_fn; hsa_api_.hsa_shut_down = table->core_->hsa_shut_down_fn; @@ -268,7 +267,6 @@ void HsaRsrcFactory::InitHsaApiTable(HsaApiTable* table) { hsa_api_.hsa_amd_profiling_get_async_copy_time = hsa_amd_profiling_get_async_copy_time; hsa_api_.hsa_amd_profiling_get_dispatch_time = hsa_amd_profiling_get_dispatch_time; } - } } hsa_status_t HsaRsrcFactory::LoadAqlProfileLib(aqlprofile_pfn_t* api) { diff --git a/src/util/hsa_rsrc_factory.h b/src/util/hsa_rsrc_factory.h index e6b19b5f..4baafdfd 100644 --- a/src/util/hsa_rsrc_factory.h +++ b/src/util/hsa_rsrc_factory.h @@ -414,7 +414,7 @@ class HsaRsrcFactory { static const char* GetKernelNameRef(uint64_t addr); // Initialize HSA API table - void static InitHsaApiTable(HsaApiTable* table); + void InitHsaApiTable(HsaApiTable* table); static const hsa_pfn_t* HsaApi() { return &hsa_api_; } // Return AqlProfile API table