ace*_*ces 1 gcc cuda future c++11
当我编译包含设计C++ 11的以下代码时,我得到错误 - 它不编译.我试过不同的旗帜,但我还没有找到解决方案.
我的设置:CUDA 6.5,gcc 4.4.7我无法更改设置.我怎么还能做这个工作?
#include <stdio.h>
#include <vector>
#include "KD_tree.h"
#include "KD_tree.cpp"
#include <iostream>
#include <algorithm>
#include <cmath>
#include <future>
#define MYDEVICE 0
using namespace std;
int main()
{
//do something.....
cudaDeviceProp devProp;
cudaGetDeviceProperties(&devProp, MYDEVICE);
printDevProp(devProp);
int max_threads = devProp.warpSize;
//do something else ...
return 0;
}
Run Code Online (Sandbox Code Playgroud)
我尝试使用不同的标志进行编译:
nvcc -std=c++11 cudaMain.cu KD_tree.cpp -arch=sm_20 -o tree.out
In file included from cudaMain.cu:14:
simple_kd_tree.h:12:19: warning: extra tokens at end of #include directive
cudaMain.cu:19:18: error: future: No such file or directory
nvcc --std=c++11 cudaMain.cu KD_tree.cpp -arch=sm_20 -o tree.out
In file included from cudaMain.cu:14:
simple_kd_tree.h:12:19: warning: extra tokens at end of #include directive
cudaMain.cu:19:18: error: future: No such file or directory
nvcc --std=c++11 cudaMain.cu KD_tree.cpp -arch=sm_20 -c -o tree.out
nvcc fatal : A single input file is required for a non-link phase when an outputfile is specified
Run Code Online (Sandbox Code Playgroud)
我是否必须拆分c ++部分?我该怎么做呢?
在CUDA 7.0中正式添加了C++ 11支持.并且您需要GCC 4.7或更高版本才能获得C++ 11支持.详情请见:http://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html#cuda-compiler-new-features
| 归档时间: |
|
| 查看次数: |
473 次 |
| 最近记录: |