记录一个程序运行时发现的 bug
在 stackoverflow 上查阅后得到解决方案如下:
-
View -> Property Pages
-
Comfiguration Properties -> CUDA C/C++ -> Common -> Generate Relocatable Device Code -> Yes (-rdc=true)
-
Configuration Properties -> CUDA C/C++ -> Device -> Code Generation -> compute_35,sm_35
-
Configuration Properties -> Linker -> Input -> Additional Dependencies -> cudadevrt.lib
运行后仍然有问题。
打开 Code Generation 页面,发现继承的值中版本低于所要求的35,自己设置的结果应该是被继承值覆盖掉了,因此取消此选项即可正常使用。