Skip to content

Clang: CUDA compile with -nocudalib gives "use of undeclared identifier cudaConfigureCall" #86660

Open
@robquill

Description

@robquill

Hi,

I am trying to compile some CUDA code without using libdevice.10.bc. To do this, I used the -nocudalib option.

Compiling the attached vecadd.cu without -nocudalib it compiles successfully:

$ clang++ vecadd.cu -emit-llvm -c --cuda-path=/usr/local/cuda-12.3
$

But compiling with -nocudalib gives this error:

$ clang++ vecadd.cu -emit-llvm -c --cuda-path=/usr/local/cuda-12.3 -nocudalib
vecadd.cu:69:11: error: use of undeclared identifier cudaConfigureCall
   69 |     vecAdd<<<gridSize, blockSize>>>(d_a, d_b, d_c, n);
      |           ^
1 error generated when compiling for sm_52.
$

My clang version is:

$ clang++ --version
Ubuntu clang version 19.0.0 (++20240325031437+564035edb0e6-1~exp1~20240325151556.1579)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-19/bin

And I'm using CUDA Toolkit 12.3.

That said, I also see this back with LLVM 14 and a range of CUDA Toolkits back to 10.1.

vecadd.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    clangClang issues not falling into any other categorycuda

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions