我找不到CUDA 5.0支持哪个版本/哪些概念的C++。在CUDA 5.0 RC附带的编程指南或参考指南中,我没有找到任何相关信息。特别是,我想知道CUDA 5.0是否支持C++11。请问有人能指点我去哪里寻找这些信息吗?
显然在5.0 RC中没有C++11功能可用。 nvcc仍然无法理解gcc 4.6标准包含的C++11语法 (参见使用CUDA和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
...
它不支持gcc 4.7,因此一些c++11特性不可用:
- Non-static data member initializers
- Template aliases :(
- Delegating constructors
- User-defined literals
- Extended friend declarations
- Explicit virtual overrides
现在如果您询问的是有关Cuda/C++或者THRUST库方面的问题,那么THRUST库在容器、迭代器和算法方面与STL C++非常相似,但它不是C++11。
nvcc编译GPU代码。nvcc支持(Cuda C和Cuda C++/thrust) gcc编译CPU代码。gcc(支持C和C++)。