From ff72129092a73b6190bc72807785987aaca2a9ed Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Tue, 17 Oct 2023 14:06:52 +0000 Subject: [PATCH] Add queries for HSA Ext interface version Change-Id: I26860fb1364cd3a33cdc9b284ac807b2702bb241 [ROCm/ROCR-Runtime commit: ed1b0b9b1ae0f7e8d5cc2004f1544227b380ccef] --- .../runtime/hsa-runtime/core/runtime/runtime.cpp | 8 ++++++++ projects/rocr-runtime/runtime/hsa-runtime/inc/hsa.h | 10 ++++++++++ 2 files changed, 18 insertions(+) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp index bb06606288..23bf7332e7 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -733,6 +733,14 @@ hsa_status_t Runtime::GetSystemInfo(hsa_system_info_t attribute, void* value) { *((bool*)value) = core::Runtime::runtime_singleton_->XnackEnabled(); break; } + case HSA_AMD_SYSTEM_INFO_EXT_VERSION_MAJOR: { + *((uint16_t*)value) = HSA_AMD_INTERFACE_VERSION_MAJOR; + break; + } + case HSA_AMD_SYSTEM_INFO_EXT_VERSION_MINOR: { + *((uint16_t*)value) = HSA_AMD_INTERFACE_VERSION_MINOR; + break; + } default: return HSA_STATUS_ERROR_INVALID_ARGUMENT; } diff --git a/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa.h b/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa.h index d1fd9aff5c..6ff5dd70d9 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa.h +++ b/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa.h @@ -519,6 +519,16 @@ typedef enum { * this attribute is bool. */ HSA_AMD_SYSTEM_INFO_XNACK_ENABLED = 0x206, + /** + * Major version of the HSA runtime extension specification supported by the + * implementation. The type of this attribute is uint16_t. + */ + HSA_AMD_SYSTEM_INFO_EXT_VERSION_MAJOR = 0x207, + /** + * Minor version of the HSA runtime extension specification supported by the + * implementation. The type of this attribute is uint16_t. + */ + HSA_AMD_SYSTEM_INFO_EXT_VERSION_MINOR = 0x208, } hsa_system_info_t; /**