有人实际上已经得到了NVCC和英特尔编译器在一起工作吗? [英] Has Anyone Actually gotten NVCC and the intel compiler to work together?

查看:162
本文介绍了有人实际上已经得到了NVCC和英特尔编译器在一起工作吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有很多问题,试图让NVCC使用intel编译器。它不工作,我得到。



人们最常见的答案是使用NVCC / cl.exe将设备代码编译成库,然后单独编译主机代码并将其链接。我试图这样,但我得到无处。



在VS2012中,我创建了一个包含2个项目的解决方案 - 一个CUDA,另一个是控制台应用程序。



我已将CUDA项目设置为使用VS2012编译成静态库。它编译没有问题。



我已经将控制台应用程序设置为intel 14.0并编译为exe。我还添加了Additional Library Dependencies的正确路径,并通过Additional Dependencies(其中我也告诉它关于cudart_static.lib)告诉编译器关于CUDA库。



构建依赖项也设置为首先编译CUDA项目。



但是,此设置不好。给我一个错误,甚至google是在损失:

 错误5错误MSB4057:目标ComputeLegacyManifestEmbedding不存在在项目中。 C:\Program Files(x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms\Win32\PlatformToolsets\Intel C ++编译器XE 14.0 \Toolset.targets 1162 7 rxnCalc_cpp 

要验证链接是否正确,如果我将两个项目都设置为通过VS2012编译,我没有问题。



操作系统 - Windows 7 64位(32位应用程序)



平台 - VS2012



Cuda Toolkit - 6.0



Cuda Compute版本 - 5.0(已编译完成)



所以,我只是浪费我的时间或有一些我缺少的东西?看来我已经经历了一百个职位,但我还没有看到一个成功。很多人急于告诉你,这是你应该做的,但没有人告诉你该怎么做!

解决方案

对于每个人,使用窗口,并试图让CUDA和英特尔编译器进行合作,请参阅我最初的问题,如何设置解决方案。



它工作,根据Roger Dahl的建议,我将CUDA项目更改为DLL。



这涉及以下修改:


  1. 将CUDA项目更改为dll


  2. 向CUDA封装函数添加__declspec >



  3. 点控制台链接器到DLL库文件

    这工作,我现在能够利用所有intel编译器优化。



    但是,请注意,我需要将intel编译器设置为只进行单文件IPO。多文件IPO会导致错误,这是有点预期。



    希望这能帮助同一艘船上的其他人。


    Lots of questions out there on trying to get NVCC to use the intel compiler. It doesn't work, I get that.

    The most common answer that people give is to compile the device code into a library using NVCC/cl.exe and then compile the host code separately and link them. I'm attempting this, but am getting nowhere.

    In VS2012 I have created a solution with 2 projects - one CUDA, the other a console application.

    I have set the CUDA project to compile with VS2012 into a static library. It compiles no problem.

    I have set the console application to intel 14.0 and to compile as an exe. I have also added the correct path to "Additional Library Dependencies" and have told the compiler about the CUDA library through "Additional Dependencies" (where I also told it about cudart_static.lib).

    Build dependency is also set to compile the CUDA project first.

    However, this setup is no good. Gives me an error which even google is at a loss for:

    Error   5   error MSB4057: The target "ComputeLegacyManifestEmbedding" does not exist in the project.   C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Platforms\Win32\PlatformToolsets\Intel C++ Compiler XE 14.0\Toolset.targets  1162    7   rxnCalc_cpp
    

    To verify that the linking is ok, if I set both projects to compile via VS2012 I get no problems.

    OS - Windows 7 64bit (32bit application though)

    Platform - VS2012

    Cuda Toolkit - 6.0

    Cuda Compute Version - 5.0 (and compiled as such)

    So, am I just wasting my time or is there something I'm missing? It seems I have gone through a hundred posts, but I have yet to see a single success. Lots of people anxious to tell you that this is what you should do, but no one to tell you how to do it!

    解决方案

    For everyone out there using windows and trying to get CUDA and the intel compiler to co-operate, see my initial question on how I set up the solution.

    To get it to work, as per Roger Dahl's suggestion, I changed the CUDA project to a DLL.

    This involved the following modifications:

    1. Change CUDA project to dll

    2. Add __declspec(dllexport) to CUDA wrapper function

    3. Point console linker to the DLL lib file

    This works and I am now able to utilize all intel compiler optimizations.

    However, please note, I did need to set the intel compiler to only do single file IPO. Multi file IPO will cause errors, this was somewhat expected.

    Hope this helps others in the same boat.

    这篇关于有人实际上已经得到了NVCC和英特尔编译器在一起工作吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆