我正在尝试用Intel编译器作为主编译器来编译cuda程序。cuda程序是用C++编写的,并使用C++11特性。如果我使用默认的主机编译器g++,那么它工作得很好。但我想试试英特尔编译器,因为g++中可能存在性能问题。
我使用的编译器是CUDA 7.5和Intel 16.0.3。它们是最新的编译器,因此都支持c++11功能。
下面是我用一个小测试文件尝试的内容:
nvcc -std=c++11 -ccbin=icpc -Xcompiler=-std=c++11 test.cu -o test
输出如下:
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 ";"
有人有同样的问题吗?如何解决?谢谢