[求助]nvcc编译Thrust代码示例出错

sinat_27688559 2016-03-25 03:41:06
是http://thrust.github.io/主页上的代码:
#include <thrust/host_vector.h>
#include <thrust/device_vector.h>
#include <thrust/generate.h>
#include <thrust/reduce.h>
#include <thrust/functional.h>
#include <algorithm>
#include <cstdlib>

int main(void)
{
// generate random data serially
thrust::host_vector<int> h_vec(100);
std::generate(h_vec.begin(), h_vec.end(), rand);

// transfer to device and compute sum
thrust::device_vector<int> d_vec = h_vec;
int x = thrust::reduce(d_vec.begin(), d_vec.end(), 0, thrust::plus<int>());
return 0;
}

在联想深腾GPU集群上运行报错:
[xulunfan@ustcgpu demo]$ nvcc demo.cu -o csr
[xulunfan@ustcgpu demo]$ ./csr
terminate called after throwing an instance of 'thrust::system::detail::bad_alloc'
what(): N6thrust6system6detail9bad_allocE: no CUDA-capable device is detected
已放弃
nvcc版本:release 4.1, V0.2.1221
...全文
247 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

579

社区成员

发帖
与我相关
我的任务
社区描述
CUDA™是一种由NVIDIA推出的通用并行计算架构,该架构使GPU能够解决复杂的计算问题。 它包含了CUDA指令集架构(ISA)以及GPU内部的并行计算引擎。
社区管理员
  • CUDA编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧