cuda 5.0支持的c++版本

c++ version supported by cuda 5.0

本文关键字:c++ 版本 支持 cuda      更新时间:2023-10-16

我找不到CUDA 5.0支持c++的哪个版本/哪些概念。我在CUDA 5.0 RC附带的《编程指南》或《参考指南》中找不到任何信息。特别是我想知道CUDA 5.0是否支持C++11。有人能给我指个地方找这些信息吗?

很明显,5.0 RC中没有C++11功能。nvcc仍然不理解gcc 4.6的标准includes中使用的C++11语法(请参阅使用CUDA和C++11时的错误):

$nvcc--版本

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,5.0候选发行说明显示,某些发行版支持的最新GCC为4.6(其他发行版支持旧版本)。

一旦您知道支持哪种GCC版本,请与GCC C++0x/C++11功能列表进行比较。

它不支持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库。推力库在容器、迭代器和算法方面与stl c++非常相似,但它不是c++11。

nvcc编译gpu代码。nvcc支持(Cuda C和Cuda C++/推力)gcc编译cpu代码。gcc(支持C和C++)。