Parsing CUDA AST using clang

I am trying to make my toy ast matchers to parse cuda code. But I am getting an error (log.txt)

log.txt (3.62 KB) (224 Bytes) (1.17 KB)

Main.cpp (1.39 KB)

Hi, there are three errors here.

error: cannot find libdevice for sm_20. Provide path to different CUDA installation via --cuda-path, or pass -nocudalib to build without linking with libdevice.

error: GPU arch sm_20 is supported by CUDA versions between 7.0 and 8.0 (inclusive), but installation at /usr/local/cuda is 10.0. Use --cuda-path to specify a different CUDA install, pass a different GPU arch with --cuda-gpu-arch, or pass --no-cuda-version-check.

If you have ideas how to make these two errors more clear, patches welcome.

error: unable to handle compilation, expected exactly one compiler job

Pass --cuda-device-only or --cuda-host-only. Right now clang is trying to compile both for host and device, and that isn’t going to work.

Hi Justin,
I don’t know where to start even to understand the error. But would like to dig deep more with some guidance.

After passing --cuda-device-only flag, I am seeing the following error:

$ ./Main --cuda-device-only

LLVM ERROR: CommonOptionsParser: failed to parse command-line arguments. [CommonOptionsParser]: Main: Unknown command line argument ‘–cuda-device-only’. Try: ‘./Main -help’

Main: Did you mean ‘-icp-invoke-only’?