silence_lamb
silence_lamb

Reputation: 377

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. The cuda program is written in C++ and using c++11 features. If I use the default host compiler g++, then it is working well. But I want to try Intel compiler because of possible performance issues in g++.

The compilers I used are CUDA 7.5 and Intel 16.0.3. They are the latest compilers, so all of them support c++11 features.

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.

Upvotes: 1

Views: 1845

Answers (1)

talonmies
talonmies

Reputation: 72349

What you are trying to do is unsupported in 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.

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)

Upvotes: 3

Related Questions