CMake: overwork std::mdspan
support for nvcc
#2445
Merged
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.
TLTR;
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