I’m trying to compile a library which includes a source file which contains a single device function and a source file which contains a single global function, which calls that device function, ie
fileA.cu:
[codebox]extern “C” {
device funcA() {
...
}
}[/codebox]
fileB.cu
[codebox]extern “C” {
extern device void funcA();
global void funcB() {
...
funcA();
...
}
}[/codebox]
However, when I try to compile fileB.cu using nvcc -c --compile --compiler-options -fPIC fileB.cu -o fileB.o, I get the error:
Error: External calls are not supported (found non-inlined call to funcA)
Is there some rule that all device functions called by a global must be included in the same file? Is there some way to fix this? Thanks.