简体   繁体   English

当使用英特尔编译器和-std = c ++ 11标志时,NVCC不工作

[英]NVCC is not working when Intel compiler and -std=c++11 flag are used

I am trying to compile the cuda program with Intel compiler as the host compiler. 我正在尝试使用英特尔编译器编译cuda程序作为主机编译器。 The cuda program is written in C++ and using c++11 features. cuda程序是用C ++编写的,使用c ++ 11特性。 If I use the default host compiler g++, then it is working well. 如果我使用默认的主机编译器g ++,那么它运行良好。 But I want to try Intel compiler because of possible performance issues in g++. 但我想尝试英特尔编译器,因为g ++中可能存在性能问题。

The compilers I used are CUDA 7.5 and Intel 16.0.3. 我使用的编译器是CUDA 7.5和Intel 16.0.3。 They are the latest compilers, so all of them support c++11 features. 它们是最新的编译器,因此它们都支持c ++ 11功能。

Here is what I tried with a small test file: 这是我尝试使用一个小测试文件:

nvcc -std=c++11 -ccbin=icpc -Xcompiler=-std=c++11 test.cu -o test

Here is the output: 这是输出:

nvcc warning : The -c++11 flag is not supported with the configured host compiler. Flag will be ignored.
/usr/local/gcc-4.8.2/include/c++/4.8.2/x86_64-unknown-linux-gnu/bits/c++config.h(190): error: identifier "nullptr" is undefined

/usr/local/gcc-4.8.2/include/c++/4.8.2/x86_64-unknown-linux-gnu/bits/c++config.h(190): error: expected a ";"

/usr/local/gcc-4.8.2/include/c++/4.8.2/exception(63): error: expected a ";"

Does anyone have the same issue and how to fix it? 有没有人有同样的问题以及如何解决它? Thanks. 谢谢。

What you are trying to do is unsupported in CUDA 7.5. 您在CUDA 7.5中不支持您尝试做的事情。 C++11 syntax is not currently supported using icc as the host compiler in CUDA 7.5, and icc 16 is not supported by CUDA 7.5. 目前,使用icc作为CUDA 7.5中的主机编译器不支持C ++ 11语法,CUDA 7.5不支持icc 16。

CUDA 8.0RC has support for use of ICC as the host compiler with the std=c++11 flag (and also support for ICC 16.0) CUDA 8.0RC支持使用ICC作为带有std = c ++ 11标志的主机编译器(并且还支持ICC 16.0)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM