adding aqlprofile member to HsaApiTable
Change-Id: Id674186dfa2e83295a51f770ccc0400f1cb51a98
This commit is contained in:
@@ -778,6 +778,10 @@ hsa_status_t GpuAgent::GetInfo(hsa_agent_info_t attribute, void* value) const {
|
||||
setFlag(HSA_EXTENSION_IMAGES);
|
||||
}
|
||||
|
||||
if (core::hsa_internal_api_table_.aqlprofile_api.hsa_ven_amd_aqlprofile_error_string_fn != NULL) {
|
||||
setFlag(HSA_EXTENSION_AMD_AQLPROFILE);
|
||||
}
|
||||
|
||||
setFlag(HSA_EXTENSION_AMD_PROFILER);
|
||||
|
||||
break;
|
||||
|
||||
@@ -74,11 +74,12 @@ void HsaApiTable::Init() {
|
||||
UpdateAmdExts();
|
||||
hsa_api.amd_ext_ = &amd_ext_api;
|
||||
|
||||
// Initialize Api tables for Finalizer and Image to NULL
|
||||
// Tables for Finalizer and Images are initialized as part
|
||||
// Initialize Api tables for Finalizer, Image, AqlProfile to NULL
|
||||
// The tables are initialized as part
|
||||
// of Hsa Runtime initialization, including their major ids
|
||||
hsa_api.finalizer_ext_ = NULL;
|
||||
hsa_api.image_ext_ = NULL;
|
||||
hsa_api.aqlprofile_ext_ = NULL;
|
||||
}
|
||||
|
||||
void HsaApiTable::Reset() {
|
||||
@@ -102,6 +103,13 @@ void HsaApiTable::CloneExts(void* ext_table, uint32_t table_id) {
|
||||
hsa_api.image_ext_ = &image_api;
|
||||
return;
|
||||
}
|
||||
|
||||
// Update HSA Extension AqlProfile Api table
|
||||
if (table_id == HSA_EXT_AQLPROFILE_API_TABLE_ID) {
|
||||
aqlprofile_api = (*(AqlProfileExtTable *)ext_table);
|
||||
hsa_api.aqlprofile_ext_ = &aqlprofile_api;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void HsaApiTable::LinkExts(void* ext_table, uint32_t table_id) {
|
||||
@@ -121,6 +129,13 @@ void HsaApiTable::LinkExts(void* ext_table, uint32_t table_id) {
|
||||
hsa_api.image_ext_ = (ImageExtTable *)ext_table;
|
||||
return;
|
||||
}
|
||||
|
||||
// Update HSA Extension AqlProfile Api table
|
||||
if (table_id == HSA_EXT_AQLPROFILE_API_TABLE_ID) {
|
||||
aqlprofile_api = (*(AqlProfileExtTable *)ext_table);
|
||||
hsa_api.aqlprofile_ext_ = (AqlProfileExtTable *)ext_table;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Update Api table for Hsa Core Runtime
|
||||
|
||||
@@ -271,6 +271,7 @@ void ExtensionEntryPoints::Unload() {
|
||||
|
||||
InitFinalizerExtTable();
|
||||
InitImageExtTable();
|
||||
InitAqlProfileExtTable();
|
||||
InitAmdExtTable();
|
||||
core::hsa_internal_api_table_.Reset();
|
||||
}
|
||||
|
||||
@@ -569,6 +569,10 @@ hsa_status_t Runtime::GetSystemInfo(hsa_system_info_t attribute, void* value) {
|
||||
setFlag(HSA_EXTENSION_IMAGES);
|
||||
}
|
||||
|
||||
if (hsa_internal_api_table_.aqlprofile_api.hsa_ven_amd_aqlprofile_error_string_fn != NULL) {
|
||||
setFlag(HSA_EXTENSION_AMD_AQLPROFILE);
|
||||
}
|
||||
|
||||
setFlag(HSA_EXTENSION_AMD_PROFILER);
|
||||
|
||||
break;
|
||||
@@ -1062,6 +1066,8 @@ void Runtime::LoadExtensions() {
|
||||
|
||||
// Update Hsa Api Table with handle of AqlProfile extension Apis
|
||||
extensions_.LoadAqlProfileApi(kAqlProfileLib[os_index(os::current_os)]);
|
||||
hsa_api_table_.LinkExts(&extensions_.aqlprofile_api,
|
||||
core::HsaApiTable::HSA_EXT_AQLPROFILE_API_TABLE_ID);
|
||||
}
|
||||
|
||||
void Runtime::UnloadExtensions() { extensions_.Unload(); }
|
||||
|
||||
Reference in New Issue
Block a user