Here is the issue: When I use the win32 release mode, it runs just as it should be, but once I change it to debug mode, it fails when compiling the project:
cudadevrt.lib(cuda_device_runtime.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL':value '0' doesn't match value '2' in kernel.
Plus, I also use the x64 debug & release mode, it turned out I can only run it with the console window disappearing immediately after it pops up. And I also can’t debug host code in x64 mode, only the device code in x64 can be debugged.
Are you running an older CUDA RC version? Update to the latest 5.5 version. Some of the older libraries had some issues with the debug builds.
You don’t mention if you’re running the Visual Studio Express version. If so, by default that one does not support x64 compilation, but it can be added to it, or you can download the professional version and not deal with that issue. If you’re a student, you can validate with an edu e-mail and download it for free at http://www.dreamspark.com