编译4.0sdk中例子无法通过遇到的问题。

请问各位,我最近安装cuda4.0,但是程序始终无法编译通过。我试着编译了sdk中的例子。
我选择了clock这个项目,3.2的编译毫无问题,4.0编译会提示一下错误:

1>------ 已启动全部重新生成: 项目: clock, 配置: Debug x64 ------
1>正在删除项目“clock”(配置“Debug|x64”)的中间文件和输出文件
1>Compiling with CUDA Build Rule…
1>“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\bin\nvcc.exe” -gencode=arch=compute_10,code="sm_10,compute_10" -gencode=arch=compute_20,code="sm_20,compute_20" --machine 32 -ccbin “C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin” -Xcompiler “/EHsc /W3 /nologo /O2 /Zi /MT " -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include” -maxrregcount=0 --compile -o “x64\Debug/clock.cu.obj” clock.cu
1>clock.cu
1>c:/NVIDIA Corporation/NVIDIA GPU Computing SDK 4.0/C/src/clock/clock.cu(101): error: identifier “cutilDeviceReset” is undefined
1>1 error detected in the compilation of “C:/Users/arion/AppData/Local/Temp/tmpxft_0000082c_00000000-8_clock.compute_10.cpp1.ii”.
1>Project : error PRJ0019: 某个工具从以下位置返回了错误代码: “Compiling with CUDA Build Rule…”
1>生成日志保存在“file://c:\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.0\C\src\clock\x64\Debug\BuildLog.htm”
1>clock - 2 个错误,0 个警告
========== 全部重新生成: 成功 0 个,失败 1 个,跳过 0 个 ==========

然后我又试着编译matrixMul这个例子,4.0提示错误是:

1>------ 已启动生成: 项目: matrixMul, 配置: Debug x64 ------
1>Compiling with CUDA Build Rule…
1>“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\bin\nvcc.exe” -gencode=arch=compute_10,code="sm_10,compute_10" -gencode=arch=compute_20,code="sm_20,compute_20" --machine 64 -ccbin “C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin” -Xcompiler “/EHsc /W3 /nologo /O2 /Zi /MT " -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include” -maxrregcount=0 --compile -o “x64\Debug/matrixMul.cu.obj” matrixMul.cu
1>matrixMul.cu
1>c:/NVIDIA Corporation/NVIDIA GPU Computing SDK 4.0/C/src/matrixMul/matrixMul.cu(37) : fatal error C1083: 无法打开包括文件:“matrixMul_kernel.cu”: No such file or directory
1>Project : error PRJ0019: 某个工具从以下位置返回了错误代码: “Compiling with CUDA Build Rule…”
1>生成日志保存在“file://c:\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.0\C\src\matrixMul\x64\Debug\BuildLog.htm”
1>matrixMul - 2 个错误,0 个警告
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========

我将源文件中#include <matrixMul_kernel.cu>改成#include ”matrixMul_kernel.cu“再次编译,继续报错,
1>------ 已启动生成: 项目: matrixMul, 配置: Debug x64 ------
1>Compiling with CUDA Build Rule…
1>“C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\bin\nvcc.exe” -gencode=arch=compute_10,code="sm_10,compute_10" -gencode=arch=compute_20,code="sm_20,compute_20" --machine 64 -ccbin “C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin” -Xcompiler “/EHsc /W3 /nologo /O2 /Zi /MT " -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include” -maxrregcount=0 --compile -o “x64\Debug/matrixMul.cu.obj” matrixMul.cu
1>matrixMul.cu
1>c:/NVIDIA Corporation/NVIDIA GPU Computing SDK 4.0/C/src/matrixMul/matrixMul.cu(197): error: identifier “cutilDeviceSynchronize” is undefined
1>c:/NVIDIA Corporation/NVIDIA GPU Computing SDK 4.0/C/src/matrixMul/matrixMul.cu(226): error: identifier “cutilDeviceSynchronize” is undefined
1>c:/NVIDIA Corporation/NVIDIA GPU Computing SDK 4.0/C/src/matrixMul/matrixMul.cu(292): error: identifier “cutilDeviceReset” is undefined
1>3 errors detected in the compilation of “C:/Users/arion/AppData/Local/Temp/tmpxft_0000204c_00000000-8_matrixMul.compute_10.cpp1.ii”.
1>Project : error PRJ0019: 某个工具从以下位置返回了错误代码: “Compiling with CUDA Build Rule…”
1>生成日志保存在“file://c:\NVIDIA Corporation\NVIDIA GPU Computing SDK 4.0\C\src\matrixMul\x64\Debug\BuildLog.htm”
1>matrixMul - 4 个错误,0 个警告
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========

在vc++目录下面,我同时包含了3.2与4.0toolkit以及sdk的相关路径,但是依旧无法解决如下问题,还希望高手能给点指点,不胜感激。

:slight_smile:

检查头文件的路径是否对,还有自定义编译规则是否对

学习一下了