[clang] [clang] Add cuda-path arguments to failing test (PR #84008)

Jonas Hahnfeld via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 5 05:41:11 PST 2024


hahnjo wrote:

> > > Might need `-nogpulib -nogpuinc` in those cases, we do that in other `.cu` files in the test suite.
> > 
> > 
> > No, I already tried that, it doesn't work for me. All `clang/test/Driver/*.cu` that supply `-nocudainc` also pass `--cuda-path`...
> 
> The only reason it will fail without a CUDA installation if you pass both `-nogpulib` and `-nogpuinc` is if you need to use `ptxas`, which shouldn't be the case if you're using options like `-###`. Tested it out by moving my CUDA installation and the following works as I expect.
> 
> ```
> > cat /dev/null | clang -x cuda - --offload-arch=sm_52 -nogpulib -nogpuinc -emit-llvm -c && echo $?
> 0
> > cat /dev/null | clang -x cuda - --offload-arch=sm_52                                  
> clang: error: cannot find libdevice for sm_52; provide path to different CUDA installation via '--cuda-path', or pass '-nocudalib' to build without linking with libdevice
> clang: error: cannot find CUDA installation; provide its path via '--cuda-path', or pass '-nocudainc' to build without CUDA includes
> clang: error: cannot find CUDA installation; provide its path via '--cuda-path', or pass '-nocudainc' to build without CUDA includes
> ```
> 
> Which tests aren't working in your case?

The invocations in `clang/test/Driver/cuda-omp-unsupported-debug-options.cu` don't pass `-emit-llvm` but `-###`.
```
 > cat /dev/null | ./bin/clang -### -x cuda - -nogpulib -nogpuinc -c && echo $?
```
should error with recent CUDA installations because of `sm_35`.

https://github.com/llvm/llvm-project/pull/84008


More information about the cfe-commits mailing list