0)Project/property/cuda/cuda-specific/Emulation/Yes(-deviceemu)
1) In "Project -> Properties (For Debug Configuration) -> Configuration Properties -> Linker -> Debugging" tab, set the value of "Generate Debug Info" to "Yes(/DEBUG)"
2) In "Project -> Properties (For Debug Configuration) -> Configuration Properties -> C/C++ -> General" tab, set the value of "Debug Information Format" to "Program Database (/Zi)" or "Program Database Edit and Continue (/ZI)"
3) In "Project -> Properties (For Debug Configuration) -> Configuration Properties -> C/C++ -> Optimization" tab, set the value of "Optimization" to "Disable (/Od)"
4) Linker->General->Enable Incremental LInking = Yes (/INCREMENTAL)
5)需要把cu文件关联到VC的project里面,不然调试的时候不能断点跟踪进去,所以必须在系统的VC++project 环境中加入*.cu文件,VS才能把你的程序和源文件关联起来,进行调试。
如果没找到关联cu,在调试的时候就会发现找不到源文件。
(转自:http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/4f560256-304c-48bd-bf89-22b065417bb8/,http://hi.baidu.com/hasae/blog/item/a38a968bad792c17c9fc7a6f.html)