8

I can't find which version/which concepts of c++ is/are supported by CUDA 5.0. I could not find any information in the Programming Guide or Reference Guide delivered with the CUDA 5.0 RC. Especially I'm wondering if CUDA 5.0 supports C++11. Could someone point me to a place to look for this information?

R. Martinho Fernandes
  • 228,013
  • 71
  • 433
  • 510
soriak
  • 672
  • 2
  • 13
  • 23

4 Answers4

7

Apperently no C++11 features are available in 5.0 RC. nvcc still does not understand C++11 syntax used in the standard includes of gcc 4.6 (see Error while using CUDA and C++11):

$ nvcc --version

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2012 NVIDIA Corporation
Built on Tue_Jul_31_17:46:14_PDT_2012
Cuda compilation tools, release 5.0, V0.2.1221

$ cat test.cu

int main()
{
}

$ nvcc -Xcompiler "-std=c++0x" test.cu

/usr/include/c++/4.6/x86_64-linux-gnu/./bits/c++config.h(159): error: identifier "nullptr" is undefined

/usr/include/c++/4.6/x86_64-linux-gnu/./bits/c++config.h(159): error: expected a ";"

/usr/include/c++/4.6/bits/exception_ptr.h(93): error: incomplete type is not allowed

...

Community
  • 1
  • 1
4

The release notes contain a list of support platforms including which versions of GCC are supported, the 5.0 Release Candidate release notes show that the most recent supported GCC is 4.6 for certain distributions (and older for other distributions).

Once you know which GCC version is supported, compare with the GCC C++0x/C++11 feature list.

Tom
  • 20,852
  • 4
  • 42
  • 54
  • @Dude: nvcc effectively splits a single file for compilation by the host compiler (in this case GCC) and the device compiler. The linker ultimately links the device objects and host objects together. I don't really understand what you mean saying only host code is compiled with GCC, no one is saying anything different but nvcc only supports certain versions (see release notes). Not sure it warranted a downvote! – Tom Oct 04 '12 at 14:13
  • OP is asking for C++11 features. Are you sure that the device compiler implements them all? – Dude Oct 18 '12 at 02:05
1

It does not support gcc 4.7 so some of the c++11 features are not available:

- Non-static data member initializers
- Template aliases :(
- Delegating constructors
- User-defined literals
- Extended friend declarations
- Explicit virtual overrides
perreal
  • 94,503
  • 21
  • 155
  • 181
  • Sorry for accepting that late, I first hoped to get a reference to the cuda documentation but that list is a great start. – soriak Jan 14 '13 at 06:22
0

now if you are asking about Cuda/C++ or the THRUST library . the thrust library is very similar to the stl c++ in regards to the containers, iterators and algorithms , but it s not c++ 11.

nvcc compiles gpu code . nvcc support ( Cuda C and Cuda C++ /thrust ) gcc compile cpu code . gcc ( support C and C++ ) .

Nadim Farhat
  • 446
  • 3
  • 11