【发布时间】:2016-11-18 23:53:25
【问题描述】:
我正在尝试使用英特尔编译器作为主机编译器来编译 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 ";"
有没有人有同样的问题以及如何解决?谢谢。
【问题讨论】:
-
只有 icc 15.0 被 CUDA 7.5 官方支持。
-
尝试更新到 CUDA 8.0RC。