I’m pretty new to CUDA. I use Microsoft Visual Studio 2010 where I don’t need to worry about writing a makefile. A problem arose as I tried to call in a .cu file a device function which was declared in the .h file and defined in another .cu file. At the end of building, I received an error message:
1>ptxas : fatal error : Unresolved extern function '_Z22atomicAddEmulateDoublePdd'
This appears in both CUDA 4.2 and 5.0. I’m wondering how should I configure my MVS to avoid this error. Sorry for the nooby questions and thanks for any suggestion!
CUDA 4.2 and does not support static linking so device functions must be defined in the same compilation unit. A common technique is to write the device function in a .cuh file and include it in the .cu file.
CUDA 5.0 supports a new feature called separate compilation. The CUDA 5.0 VS msbuild rules should be available in the CUDA 5.0 RC download.