目前遵循 Microsoft Windows 的 CUDA 入门指南 [ http://docs.nvidia.com/cuda/cuda-getting-started-guide-for-microsoft-windows/index.html ];安装了 CUDA;样本和 NSight;我在 Visual Studio 2010 上;我检查了我的卡,它支持 CUDA。我按照教程一直到演示部分......但我收到以下错误消息:
==================================================== ====================================
1>CudaBuild:
1> Compiling CUDA source file bandwidthTest.cu...
1>
1> C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.0\1_Utilities\bandwidthTest>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\bin\nvcc.exe" -gencode=arch=compute_10,code=\"sm_10,compute_10\" -gencode=arch=compute_20,code=\"sm_20,compute_20\" -gencode=arch=compute_30,code=\"sm_30,compute_30\" -gencode=arch=compute_35,code=\"sm_35,compute_35\" --use-local-env --cl-version 2010 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin" -I"./" -I"../../common/inc" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include" -G --keep-dir "Debug" -maxrregcount=0 --machine 32 --compile -g -DWIN32 -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /Zi /RTC1 /MTd " -o "Win32/Debug/bandwidthTest.cu.obj" "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.0\1_Utilities\bandwidthTest\bandwidthTest.cu"
1> bandwidthTest.cu
1>C:/ProgramData/NVIDIA Corporation/CUDA Samples/v5.0/1_Utilities/bandwidthTest/bandwidthTest.cu(117): error : identifier "cin" is undefined
1>
1> 1 error detected in the compilation of "C:/Users/James/AppData/Local/Temp/tmpxft_00001654_00000000-14_bandwidthTest.compute_35.cpp1.ii".
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\BuildCustomizations\CUDA 5.0.targets(592,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\bin\nvcc.exe" -gencode=arch=compute_10,code=\"sm_10,compute_10\" -gencode=arch=compute_20,code=\"sm_20,compute_20\" -gencode=arch=compute_30,code=\"sm_30,compute_30\" -gencode=arch=compute_35,code=\"sm_35,compute_35\" --use-local-env --cl-version 2010 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin" -I"./" -I"../../common/inc" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include" -G --keep-dir "Debug" -maxrregcount=0 --machine 32 --compile -g -DWIN32 -D_MBCS -Xcompiler "/EHsc /W3 /nologo /Od /Zi /RTC1 /MTd " -o "Win32/Debug/bandwidthTest.cu.obj" "C:\ProgramData\NVIDIA Corporation\CUDA Samples\v5.0\1_Utilities\bandwidthTest\bandwidthTest.cu"" exited with code 2.
1>
1>Build FAILED.
==================================================== ====================================
我承认 cin 是 iostream 的一部分,我已经验证它是我的代码中包含指令的一部分......
我来自网络开发人员的背景;我很少对这些类型进行编程......