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

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 5 05:28:27 PST 2024


jhuber6 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?

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


More information about the cfe-commits mailing list