为什么下面的代码会在 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。
谢谢