-
Notifications
You must be signed in to change notification settings - Fork 195
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
Restrict the use of [[no_unique_address]]
to CXX 20 only.
#764
Restrict the use of [[no_unique_address]]
to CXX 20 only.
#764
Conversation
(!defined(__NVCC__) || ((__CUDACC_VER_MAJOR__ > 11) && (__CUDACC_VER_MINOR__ > 5))) | ||
# if (__has_cpp_attribute(no_unique_address) >= 201803L) && !defined(_MDSPAN_COMPILER_MSVC) | ||
#if !defined(_MDSPAN_USE_ATTRIBUTE_NO_UNIQUE_ADDRESS) | ||
# if MDSPAN_HAS_CXX_20 && (__has_cpp_attribute(no_unique_address) >= 201803L) |
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.
Thanks for the proposed fix! This looks reasonable. Users can always turn off the feature if their compiler doesn't support it. Are you able to test with MDSPAN_HAS_CXX_20
?
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.
doesn't that mean you always turn it off for NVCC since nvcc does not support C++20?
I think we should merge this, but I want to make sure if we have to merge in updates from Kokkos in the future then this won't be reverted if they haven't made the same updates by then. Can we do a quick update of our fork of Kokkos/mdspan and apply this change there too? |
@gpucibot merge |
I will open a PR upstream tomorrow. |
Thankis again for the fix @trivialfis (and @achirkin)! |
Thanks @trivialfis ! |
Close #740 .
Found by @achirkin , the size of
mapping
is non-deterministic. This is caused by the macro definition around whetherno_unique_address
is supported with nvcc. This PR uses the standard cpp version to define the macro regardless of the compiler being used.