当遇到这种错误的时候,如下
Error:ptxas fatal : Unresolved extern function Error 255
ptxas fatal : Unresolved extern function 'cudaDeviceSynchronize'
上面这个错误的解决方法都是:需要分开编译文件,对应的编译参数为–relocatable-device-code={true,false}将false 改为 true
nsight 的设置的位置为:
In Nsight Eclipse, the option is available as the radio button “Separate compilation” under Project > Properties > Build > Settings > CUDA > switch to advanced mode 里面勾选就可以了。
VS的设置方法估计类似,可以百度一下。
如下图: