Open
Conversation
Signed-off-by: 372046933 <wondertx@gmail.com>
c923306 to
9596173
Compare
Author
|
Or typedef struct alignas(8) __attribute__((packed)) {
ncclGinProxyQword_t qword[8];
} ncclGinProxyGfd_t;IMHO, removing these attribute makes it simple |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Below is the smallest reproducible code. the
__attribute__((packed))onncclGinProxyGfd_tmakes the alignment of ncclGinProxyGfd_t equals to 1. The packed struct here is not needed for two reasons.ncclGinProxyQword_tis already packed and size of it is 8 bytes. So size ofncclGinProxyGfd_tis 64 bytes. andpackedis redundant here.gcc does not give any warning. But clang does.
Related Issues
If we are going to support clang, this packed must be removed, otherwise
libatomicneeds to be linked.#1744
Changes & Impact
This PR does not affect GCC. For clang, the generated code does not need link to
libatomicPerformance Impact
No difference for GCC. Significant performance improvement on clang since libatomic call is eliminated