sinpi and cospi in global namespace

Hi everyone,

with the new CUDA 4.0 we do have sinpi and cospi functions in CUDA. Thanks a lot for this, it is very convenient to haven them.

However, I am confused by the fact that I do have these functions in the global namespace, even if I do not use them and I do not include anything.

So having an empty Testing_kernel.cu and in Testing.cpp this code:

extern "C"{

double sinpi(double x)  { return sin(3.1415 /*...*/ *x); }

}

leads to the following error (MSVC8):

Testing_kernel.cu.obj : error LNK2005: sinpi already defined in Testing.obj

Can sinpi and cospi defined in CUDA without having it in the global namespace of the linker? Maybe always inlining it?

thanks a lot in advance,

best regards,

Andreas Buhr

when nvcc compiles an application, it automatically #includes a number of cuda header files - all the math operations in CUDA are defined in these header files, so it makes sense that sinpi and cospi are there as well.