-
Notifications
You must be signed in to change notification settings - Fork 13.2k
[OpenMP][test]Flip bit-fields in 'struct flags' for big-endian in test cases #79895
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
Conversation
…h the runtime definition in kmp.h.
✅ With the latest revision this PR passed the C/C++ code formatter. |
The change looks good to me. One thing though: grepping for |
…clude file common.h.
Thanks for checking, @iii-i! Changed |
Gentle ping...Are there any further comments or concerns? |
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.
LGTM
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.
I suggest to add a comment in kmp.h, that provides the hint of explicit copy of the struct in tests and that any changes to the struct should be applied to the tests.
Can you add this comment as part of your patch?
Overall looks good to me.
unsigned set : 1; | ||
unsigned unused : 3; | ||
unsigned all : 1; | ||
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ |
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.
I was wondering whether this test is compiler(clang) specific, or is this portable?
Since kmp.h has the same code, it make sense to replicate the pattern here.
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.
I was wondering whether this test something that is compiler(clang) specific, or is this portable?
Checked compilers in Compiler Explorer, the test works with gcc, clang, icc, icx, and zig cc. Does not seem to work with msvc.
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.
This is something that would also need to be addressed in kmp.h.
Does this versioning have a correctness implication, or is this a performance optimization?
In the latter case, from my perspective, a viable approach would be hardcode the endianess, if the two macros are undefined.
It's your choice to fix it as part of this patch or whether you prefer to fix it in a separate pr:)
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.
I would do it in a separate PR.
Thanks very much, @jprotze! Yeah, it will be helpful to mention that test cases have an explicit copy of the struct. I will add the comment to |
I'm not sure whether you have the permissions to merge, if not just leave a comment and Kelvin or I will hit the merge button |
Thanks, I have the permission. |
* Add a comment in kmp.h to mention that some test cases contain an explicit copy of struct kmp_depend_info.
…t cases (llvm#79895) This patch flips bit-fields in `struct flags` for big-endian in test cases to be consistent with the definition of the structure in libomp `kmp.h`. (cherry picked from commit 7a9b0e4)
…t cases (llvm#79895) This patch flips bit-fields in `struct flags` for big-endian in test cases to be consistent with the definition of the structure in libomp `kmp.h`. (cherry picked from commit 7a9b0e4)
This patch flips bit-fields in
struct flags
for big-endian in test cases to be consistent with the definition of the structure in libompkmp.h
.