Skip to content
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

nvcc and use of [[no_unique_address]] #198

Open
youyu3 opened this issue Oct 19, 2022 · 1 comment
Open

nvcc and use of [[no_unique_address]] #198

youyu3 opened this issue Oct 19, 2022 · 1 comment

Comments

@youyu3
Copy link
Contributor

youyu3 commented Oct 19, 2022

In config.hpp there are these checks for using [[no_unique_address]] or using an emulation of it.

#if !defined(_MDSPAN_USE_ATTRIBUTE_NO_UNIQUE_ADDRESS)
#  if ((__has_cpp_attribute(no_unique_address) >= 201803L) && \
       (!defined(__NVCC__) || MDSPAN_HAS_CXX_20) && \
       (!defined(_MDSPAN_COMPILER_MSVC) || MDSPAN_HAS_CXX_20))
#    define _MDSPAN_USE_ATTRIBUTE_NO_UNIQUE_ADDRESS 1
#    define _MDSPAN_NO_UNIQUE_ADDRESS [[no_unique_address]]
#  else
#    define _MDSPAN_NO_UNIQUE_ADDRESS
#  endif
#endif

Using of [[no_unique_address]] is disabled if it's compiled by nvcc. Is this just because this was not supported by nvcc at some point?

Current nvcc does support it now (as long as the host compiler supports it).

@crtrott
Copy link
Member

crtrott commented Nov 23, 2022

There were also issues with working slightly different on host and device, and that leading to mismatched sizes.

mhoemmen added a commit to mhoemmen/mdspan that referenced this issue Jul 26, 2023
Add missing include to fix Mac clang-13 build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants