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

CMake: overwork std::mdspan support for nvcc #2445

Merged

Conversation

SimeonEhrig
Copy link
Member

@SimeonEhrig SimeonEhrig commented Jan 8, 2025

TLTR;

  • abort CMake configuration with error if nvcc experimental lamda support is disabled than mdspan is throwing a compiler error for the missing feature
  • allow to use nvcc and mspan with clang as host compiler

MdSpan throws a readable compiler error if the nvcc experimental extension is disabled. Actual the CMake should avoid it, because it should automatically disable mdspan but it does not work. Also the behavior feels wrong. An explicit enabled feature is automatically disabled. I think it is better, if the user knows, that is not working and ether disable mdspan or find another solution.

Also the PR enables using nvcc with host compiler clang and mdspan. This was disabled with initial support of mdspan. There is no documentation about what was the actual compiler problem. For me, it was less work to remove the restriction in CMake than writing a job generator filter rule. So tried it and the test pass. So I will keep it, because it is the better solution.

Compile time error message: https://gitlab.com/hzdr/crp/alpaka/-/jobs/8788083447

separated from PR: #2315

@SimeonEhrig SimeonEhrig added this to the 2.0.0 milestone Jan 8, 2025
@SimeonEhrig SimeonEhrig force-pushed the mdspanCUDAExperimentalLamba branch 2 times, most recently from e03c7b8 to c46c15c Compare January 8, 2025 14:07
@SimeonEhrig SimeonEhrig marked this pull request as draft January 8, 2025 15:45
…AMBDA is disabled

- Instead automatically disabling mdspan if alpaka_CUDA_EXPT_EXTENDED_LAMBDA is off throw an error. That's more expected behavior than an enabled feature is off. Also the old behavior does not worked, because mdspan was still compiled and throws a compiler error.
- Fix bug, that the Clang as CUDA compiler was also affected by the CMake options alpaka_CUDA_EXPT_EXTENDED_LAMBDA, which sets a nvcc flag.
@SimeonEhrig SimeonEhrig force-pushed the mdspanCUDAExperimentalLamba branch from c46c15c to fbe8081 Compare January 8, 2025 16:08
@SimeonEhrig SimeonEhrig changed the title CMake: add check that nvcc expertental lamda support is enabled if MdSpan is active CMake: overwork check of nvcc expertental lamda support is enabled if MdSpan is active Jan 8, 2025
@SimeonEhrig SimeonEhrig marked this pull request as ready for review January 8, 2025 16:12
@SimeonEhrig SimeonEhrig changed the title CMake: overwork check of nvcc expertental lamda support is enabled if MdSpan is active CMake: overwork std::mdspan support for nvcc Jan 9, 2025
@psychocoderHPC psychocoderHPC merged commit 2ca7904 into alpaka-group:develop Jan 9, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants