From cd8e5c1da8242c587e8dea97cdbd53cf21303a0f Mon Sep 17 00:00:00 2001 From: Sean Keely Date: Mon, 20 Aug 2018 20:41:35 -0500 Subject: [PATCH] Expose ROCr build ID. Adds HSA_AMD_SYSTEM_INFO_BUILD_VERSION=0x200 to hsa_system_info_t. This returns a const char* pointing at the build string (git describe). Change-Id: I73e6612482bf6ffc4037fd365808eb9211a650ad --- runtime/hsa-runtime/core/runtime/runtime.cpp | 4 ++++ runtime/hsa-runtime/inc/hsa.h | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/runtime/hsa-runtime/core/runtime/runtime.cpp b/runtime/hsa-runtime/core/runtime/runtime.cpp index d2ed99119c..f1a8b35c80 100644 --- a/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -585,6 +585,10 @@ hsa_status_t Runtime::GetSystemInfo(hsa_system_info_t attribute, void* value) { break; } + case HSA_AMD_SYSTEM_INFO_BUILD_VERSION: { + *(const char**)value = STRING(ROCR_BUILD_ID); + break; + } default: return HSA_STATUS_ERROR_INVALID_ARGUMENT; } diff --git a/runtime/hsa-runtime/inc/hsa.h b/runtime/hsa-runtime/inc/hsa.h index 0ed2b689e2..3979219a8e 100644 --- a/runtime/hsa-runtime/inc/hsa.h +++ b/runtime/hsa-runtime/inc/hsa.h @@ -476,7 +476,11 @@ typedef enum { * implementation. An extension with an ID of @p i is supported if the bit at * position @p i is set. The type of this attribute is uint8_t[128]. */ - HSA_SYSTEM_INFO_EXTENSIONS = 7 + HSA_SYSTEM_INFO_EXTENSIONS = 7, + /** + * String containing the ROCr build identifier. + */ + HSA_AMD_SYSTEM_INFO_BUILD_VERSION = 0x200 } hsa_system_info_t; /**