extern __device__ functions

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.

Yes. device functions are inlined by the compiler and there is no cuda linker, so everything the compiler needs must be available in the same logical compilation unit. This includes device functions, constant variables and textures.

Is there some way to fix this? Thanks.

None that I am aware of.