compiler-explorer / compiler-explorer/infra
Allow usage of C++20 library features with CUDA 12 nvcc
- Dominant language
- Python
- Stars
- 434
- Forks
- 429
- Avg merge
- 4d 21h
- Merged PRs (30d)
- 38
Description
CUDA 12 supports C++20 but depends on the host compiler for library features like iterator concepts (I think CCCL trunk's libcu++ might also provide these specifically as `cuda::std::` but that is beside the point). At the moment all CUDA versions are installed on top of some old GCC (10.2.0) which doesn't ship these features: [Example](https://cuda.godbolt.org/z/Ysrx4dMx8)
According to [Spack's internals](https://github.com/spack/spack/blob/9c88a48a731a53accfc88a52163f5fc3b26bac6e/lib/spack/spack/build_systems/cuda.py#L135-L139)
- CUDA >= 11.5 supports GCC 11.1
- CUDA >= 11.6 supports GCC 11.2
- CUDA >= 12.0 supports GCC 12
- CUDA >= 12.4 supports GCC 13 (although there have been some problems with CUDA 12.4.0 concerning GCC 13 prompting fixes in CUDA 12.4.1)
It is possible to change the host compiler (and therefore the standard library, I guess. If I get the right path I would try it out.) using nvcc's [`-ccbin`](https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#compiler-bindir-directory-ccbin), but I think it would be cool if each CUDA version on Compiler Explorer would just use the newest supported GCC out of the box.
If the paths to other host compilers were listed (or at least a list of them linked) somewhere in the GUI for easy access usage would be even more flexible as one might want to use e.g. clang++ instead of g++ as host compiler).
Ideally one would have both I guess - better defaults and easier access to paths for customization.
Contributor guide
Research direction
Start with Spack's CUDA build-system logic at the linked cuda.py lines and nvcc's -ccbin documentation to compare supported host compilers for each CUDA version. Check how Compiler Explorer exposes compiler options in the GUI; done means CUDA versions use the newest supported GCC by default and users can find host compiler paths for customization.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100