tambre added a comment.

Thank you for the long and detailed explanation. It's been of great help!

I've gone with the approach of trying the architectures in the most recent 
non-deprecated order – sm_52, sm_30.  
A problem with bumping the default architecture would have been that there are 
already Clang version released, which support CUDA 10, but still use sm_20 by 
default. CMake probably wants to support the widest range possible.

> Can you elaborate on what exactly does cmake attempts to establish with the 
> test?
>  If it looks for a working end-to-end CUDA compilation, then it will need to 
> rely on user input to make sure that correct CUDA location is used.
>  If it wants to check if clang is capable of CUDA compilation, then it should 
> be told *not* to look for CUDA (though you will need to provide a bit of glue 
> similar to what we use for tests 
> https://github.com/llvm/llvm-project/blob/master/clang/test/Driver/cuda-simple.cu).
>  Would something like that be sufficient?

The aim is to check for working end-to-end CUDA compilation.

You're right that CMake ought to rely on the user to provide many of the 
variables.  
I'll be adding a `CUDA_ROOT` option to CMake that will be passed to clang as 
`--cuda-path`.  
CMake also currently lacks options to pass an architecture to the CUDA compiler 
though this feature has been requested multiple times. Users so far had to do 
this themselves by passing raw compiler flags. I'm also working on support for 
this. The first detected working architecture during compiler identification 
will be used as the default.

After some work on my CMake changes, Clang detection as a CUDA compiler works 
and I can compile CUDA code.  
However code using separable compilation doesn't compile. What is the Clang 
equivalent of NVCC's `-dc` (`--device-c`) option for this case?

The CMake code review for CUDA Clang support is here 
<https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4442>.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75811/new/

https://reviews.llvm.org/D75811



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to