-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hsa-runtime: set underlying type of hsa_region_info_t, hsa_amd_region_info_t to int #274
base: amd-staging
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change commit subject to:
rocr: set underlying type of hsa_region_info_t, hsa_amd_region_info_t
And wrap commit message body at 72 characters.
Otherwise looks good to me
When an enum's backing type is not set explicitly it is undefined behavior to load a value that is not one of the specific values it was defined with. See https://eel.is/c++draft/expr.static.cast#9
39a6a16
to
441137d
Compare
@dayatsin-amd Commit message and title updated |
Thank you @LunNova we will submit this patch from out internal repo. |
!verify full |
!verify |
We are getting some compiler errors internally due to this change. Will have to re-visit this. |
@dayatsin-amd Looks good, approved the PR you opened. |
When an enum's backing type is not set explicitly it is undefined behavior to load a value that is not one within the range of values it was defined with after https://cplusplus.github.io/CWG/issues/1766.html
This causes UB because ROCR-Runtime casts back and forth between
hsa_amd_region_info_s
andhsa_region_info_t
types.ROCR-Runtime/samples/common/common.cpp
Line 37 in 2d40493
Fixes one of the errors reported in #272: