[llvm-bugs] [Bug 45982] New: Device friend function is not seen in different file
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon May 18 12:57:34 PDT 2020
https://bugs.llvm.org/show_bug.cgi?id=45982
Bug ID: 45982
Summary: Device friend function is not seen in different file
Product: clang
Version: 10.0
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: CUDA
Assignee: unassignedclangbugs at nondot.org
Reporter: nikolay_nechaev at mail.ru
CC: llvm-bugs at lists.llvm.org
Created attachment 23505
--> https://bugs.llvm.org/attachment.cgi?id=23505&action=edit
The archive containing files being compiled
I figure out it's a bug because `nvcc` compiles this without issues, but
`clang` gives a compilation error
I have got the `MyClass` class described at MyClass.cu, MyClass.cuh files.
There is a friend function declared in .cuh and defined in .cu file. The header
is included to main.cu, the project is compiled with both cu files.
Compilation commands are `nvcc main.cu MyClass.cu` and `clang++-10
--cuda-gpu-arch=sm_30 -L/usr/local/cuda/lib64 -lcudart_static -ldl -lrt
-pthread main.cu MyClass.cu`
Expected behaviour (like `nvcc`)
No output is produced, an executable is created
Actual behaviour (`clang`'s)
Getting compilation error:
```
main.cu:8:5: error: use of undeclared identifier 'init'
init<<<1, 1>>>(&obj);
^
1 error generated when compiling for sm_30.
```
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200518/b8aadab1/attachment.html>
More information about the llvm-bugs
mailing list