Skip to content

CUDA: Clang support

Raul Tambre requested to merge tambre/cmake:cuda_clang_id into master
  • Clang identification.
  • Crosscompilation support.
    • Sysroot is passed during compiler identification.
    • CMAKE_CUDA_ARCHITECTURES is respected during compiler identification if set in toolchain file.
  • Compiler-specific module. Sets language flag and re-uses general Clang flags for the rest.
    • Supports PTX compilation.
    • Doesn't support separate compilation yet, as it works quite differently on Clang. Hope to add support in the future.
  • Tests are updated to work with Clang.
  • pthread, rt and dl are now considered a part of CUDA runtime libraries.
  • Some logic from FindCUDAToolkit is refactored into Internal/CUDAToolkit, so it can be used CMakeDetermineCUDACompiler.

Clang CUDA documentation.
Upstream LLVM CUDA developer's advice on CMake integration.

Fixes: #16586 (closed)
Topic-rename: cuda-clang

Edited by Brad King

Merge request reports