小编bc5*_*547的帖子

使用推力 device_vector 作为全局变量

为什么下面的代码会在 main 的末尾崩溃?

#include <thrust/device_vector.h>

thrust::device_vector<float4> v;

int main(){
    v.resize(1000);
    return 0;
}
Run Code Online (Sandbox Code Playgroud)

错误是:

terminate called after throwing an instance of 'thrust::system::system_error'
what():  unspecified driver error
Run Code Online (Sandbox Code Playgroud)

如果我使用host_vector而不是device_vector代码运行良好。

你认为这是一个推力错误,还是我在这里做错了什么?

我在带有 cuda 4.0 的 ubuntu 10.10 和带有 cuda 6.5 的 Windows 7 上尝试过。在这两种情况下,Thrust 版本都是 1.7。

谢谢

cuda thrust

3
推荐指数
1
解决办法
1099
查看次数

标签 统计

cuda ×1

thrust ×1