From 51b4fb691af5ee1dfea17559f5eabbacdf7359ac Mon Sep 17 00:00:00 2001 From: David Yat Sin Date: Tue, 9 Aug 2022 10:00:37 -0400 Subject: [PATCH] Add max enum value to hsa_agent_info_t Add max enum value to force size of enum and avoid clang compile warnings. Change-Id: I9cdf529517cc605a5039c3a924fd718ece16029d [ROCm/ROCR-Runtime commit: 86e4cb1ddd76ceb32c3985bd4813b4b6f03fb01b] --- projects/rocr-runtime/runtime/hsa-runtime/inc/hsa.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa.h b/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa.h index fe1facca44..96730baf35 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa.h +++ b/projects/rocr-runtime/runtime/hsa-runtime/inc/hsa.h @@ -1012,8 +1012,16 @@ typedef enum { * Minor version of the HSA runtime specification supported by the * agent. The type of this attribute is uint16_t. */ - HSA_AGENT_INFO_VERSION_MINOR = 22 - + HSA_AGENT_INFO_VERSION_MINOR = 22, + /** + * This enum does not have a fixed underlying type, thus in C++ post D2338: + * If the enumeration type does not have a fixed underlying type, the value is + * unchanged if the original value is within the range of the enumeration + * values (9.7.1 [dcl.enum]), and otherwise, the behavior is + * undefined. + * Thus increase the range of this enum to encompass vendor extensions. + */ + HSA_AGENT_INFO_LAST = INT32_MAX } hsa_agent_info_t; /**