From 0fcd2fa56e3f2fee4dbbfa038414ef772c09c17f Mon Sep 17 00:00:00 2001 From: Evgeny Date: Fri, 27 Apr 2018 20:20:47 -0500 Subject: [PATCH] aqlprofile: get version API Change-Id: I3a85c088bfff3f54d8829e17cdafd7dfcdfb0c1d --- runtime/hsa-runtime/core/runtime/hsa.cpp | 6 ++++++ runtime/hsa-runtime/inc/hsa_ven_amd_aqlprofile.h | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/runtime/hsa-runtime/core/runtime/hsa.cpp b/runtime/hsa-runtime/core/runtime/hsa.cpp index c8a8a86435..3444bceddf 100644 --- a/runtime/hsa-runtime/core/runtime/hsa.cpp +++ b/runtime/hsa-runtime/core/runtime/hsa.cpp @@ -477,6 +477,12 @@ hsa_status_t hsa_system_get_major_extension_table(uint16_t extension, uint16_t v } hsa_ven_amd_aqlprofile_1_00_pfn_t ext_table; + ext_table.hsa_ven_amd_aqlprofile_version_major = + (decltype(::hsa_ven_amd_aqlprofile_version_major)*) + os::GetExportAddress(lib, "hsa_ven_amd_aqlprofile_version_major"); + ext_table.hsa_ven_amd_aqlprofile_version_minor = + (decltype(::hsa_ven_amd_aqlprofile_version_minor)*) + os::GetExportAddress(lib, "hsa_ven_amd_aqlprofile_version_minor"); ext_table.hsa_ven_amd_aqlprofile_error_string = (decltype(::hsa_ven_amd_aqlprofile_error_string)*) os::GetExportAddress(lib, "hsa_ven_amd_aqlprofile_error_string"); diff --git a/runtime/hsa-runtime/inc/hsa_ven_amd_aqlprofile.h b/runtime/hsa-runtime/inc/hsa_ven_amd_aqlprofile.h index eee73627da..bf216619a1 100644 --- a/runtime/hsa-runtime/inc/hsa_ven_amd_aqlprofile.h +++ b/runtime/hsa-runtime/inc/hsa_ven_amd_aqlprofile.h @@ -50,10 +50,18 @@ #include #include "hsa.h" +#define HSA_AQLPROFILE_VERSION_MAJOR 2 +#define HSA_AQLPROFILE_VERSION_MINUR 0 + #ifdef __cplusplus extern "C" { #endif // __cplusplus +//////////////////////////////////////////////////////////////////////////////// +// Library version +uint32_t hsa_ven_amd_aqlprofile_version_major(); +uint32_t hsa_ven_amd_aqlprofile_version_minor(); + /////////////////////////////////////////////////////////////////////// // Library API: // The library provides helper methods for instantiation of @@ -292,6 +300,9 @@ static const char kAqlProfileLib[] = "libhsa-amd-aqlprofile.so.1"; * @brief Extension function table. */ typedef struct hsa_ven_amd_aqlprofile_1_00_pfn_s { + uint32_t (*hsa_ven_amd_aqlprofile_version_major)(); + uint32_t (*hsa_ven_amd_aqlprofile_version_minor)(); + hsa_status_t (*hsa_ven_amd_aqlprofile_error_string)( const char** str);