Intel C/C++ Compiler 无疑是高性能编译器,基于Cuda的GPU计算能力非凡,在VS2013下集成二等用于摄影测量问题求解,图像处理等密集计算问题,无疑是技术控们的不二选择。
本人花费了许多时间把这两个东西关联到一起,处理过程供同仁参考。
1. 安装vs2013.4_ult_enu.iso
2. 安装INTEL_PS_XE_2015.iso
3. 安装NVIDIA_Nsight_Visual_Studio_Edition_Win64_4.6.0.15071.msi
4. 直接打开C:\ProgramData\NVIDIA Corporation\CUDA Samples\v7.0\Samples_vs2013.sln工程, 从工程中任意选择一个例如3bicubicTexture,直接编译运行是完全正常的,我们打开该工程的属性页可以看到工程编译使用的是 Visual Studio 2013 (v120)
5. 我们现在选择Intel C/C++编译器:[Project]-->[Intel Compiler XE 15.0]-->(Use Intel C++)
6. 重新编译工程bicubicTexture 非常不幸,编译器大量报错。
7. 经过几天的折腾,发现只要修改C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\BuildCustomizations\CUDA 7.0.props即可完美解决问题。
8. 修改位置如下:
a) 更换当前编译器版本号<p> <PropertyGroup>
<CudaToolkitNvccPath Condition="'$(CudaToolkitNvccPath)' == ''">$(CudaToolkitBinDir)\nvcc.exe</CudaToolkitNvccPath></p><p> <CudaClVersion Condition="'$(PlatformToolset)' == 'v100'">2010</CudaClVersion>
<CudaClVersion Condition="'$(PlatformToolset)' == 'Windows7.1SDK'">2010</CudaClVersion>
<CudaClVersion Condition="'$(PlatformToolset)' == 'v110'">2012</CudaClVersion>
<CudaClVersion Condition="'$(PlatformToolset)' == 'v120'">2013</CudaClVersion></p><p> <CudaClVersion Condition="'$(CudaClVersion)' == ''"><span style="background-color: rgb(255, 0, 0);">2013</span></CudaClVersion> 《----为2013</p><p> <CudaContinueOnError>false</CudaContinueOnError>
<CudaLogStandardErrorAsError>false</CudaLogStandardErrorAsError></p><p> <CudaIntDir>$(IntDir)</CudaIntDir>
<CudaIntDir Condition="HasTrailingSlash('$(CudaIntDir)')">$(CudaIntDir.Trim('\'))</CudaIntDir></p><p>b)设置编译器为Intel compiler编译器</p><p> <!-- Added so that the correct platform's bin directory is used for ccbin -->
<VCBinDir Condition="'$(Platform)' == 'Win32'">$(VCInstallDir)bin</VCBinDir>
<VCBinDir Condition="'$(Platform)' == 'x64'">$(VCInstallDir)bin\x86_amd64</VCBinDir>
<VCBinDir Condition="'$(Platform)' == 'Win32' AND '$(CudaPreferredToolArchitecture)' == 'x64'">$(VCInstallDir)bin\amd64_x86</VCBinDir>
<VCBinDir Condition="'$(Platform)' == 'x64' AND '$(CudaPreferredToolArchitecture)' == 'x64'">$(VCInstallDir)bin\amd64</VCBinDir>
<span style="background-color: rgb(255, 255, 102);"><!-- sgz add Cuda include Intel C++ XE -->
<VCBinDir Condition="'$(PlatformToolset)' == 'Intel C++ Compiler XE 15.0'">$(ICInstallDir)bin\intel64</VCBinDir></span></p><p> </p><p>c)明确指定编译器icl.exe</p>
<BaseCommandLineTemplate>-ccbin "%(VCBinDir)\bin\icl.exe" [GenerateRelocatableDeviceCode] [Include] [RequiredIncludes] [InterleaveSourceInPTX] [GPUDebugInfo] [GenerateLineInfo] [Keep] [KeepDir] [MaxRegCount] [PtxAsOptionV] [TargetMachinePlatform] [NvccCompilation] [CudaRuntime] [AdditionalOptions]</BaseCommandLineTemplate>
<BuildCommandLineTemplate>--use-local-env --cl-version $(CudaClVersion)</BuildCommandLineTemplate>