From 7b59f24005e1ae1c4d7a8069c00d94d92717fe86 Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Tue, 17 Oct 2023 14:07:48 +0000 Subject: [PATCH] Add query for HSA Ext interface version Change-Id: Ibfac8c23b173793f7302f926c4695a1f99b328fe --- rocminfo.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/rocminfo.cc b/rocminfo.cc index 4b7b287..9e88cd3 100755 --- a/rocminfo.cc +++ b/rocminfo.cc @@ -90,6 +90,7 @@ // calls, and is later used for reference when displaying the information. struct system_info_t { uint16_t major, minor; + uint16_t ext_major, ext_minor; uint64_t timestamp_frequency = 0; uint64_t max_wait = 0; hsa_endianness_t endianness; @@ -262,6 +263,14 @@ static hsa_status_t AcquireSystemInfo(system_info_t *sys_info) { err = hsa_system_get_info(HSA_SYSTEM_INFO_VERSION_MINOR, &sys_info->minor); RET_IF_HSA_ERR(err); + // Get HSA Ext Interface version + err = hsa_system_get_info(HSA_AMD_SYSTEM_INFO_EXT_VERSION_MAJOR, + &sys_info->ext_major); + RET_IF_HSA_ERR(err); + err = hsa_system_get_info(HSA_AMD_SYSTEM_INFO_EXT_VERSION_MINOR, + &sys_info->ext_minor); + RET_IF_HSA_ERR(err); + // Get timestamp frequency err = hsa_system_get_info(HSA_SYSTEM_INFO_TIMESTAMP_FREQUENCY, &sys_info->timestamp_frequency); @@ -288,12 +297,15 @@ static hsa_status_t AcquireSystemInfo(system_info_t *sys_info) { err = hsa_system_get_info(HSA_AMD_SYSTEM_INFO_DMABUF_SUPPORTED, &sys_info->dmabuf_support); RET_IF_HSA_ERR(err); + return err; } static void DisplaySystemInfo(system_info_t const *sys_info) { printLabel("Runtime Version:"); printf("%d.%d\n", sys_info->major, sys_info->minor); + printLabel("Runtime Ext Version:"); + printf("%d.%d\n", sys_info->ext_major, sys_info->ext_minor); printLabel("System Timestamp Freq.:"); printf("%fMHz\n", sys_info->timestamp_frequency / 1e6); printLabel("Sig. Max Wait Duration:");