为什么下面的代码在 main 函数结束时会崩溃?
如果我使用host_vector而不是device_vector,代码就可以正常运行。你觉得这是一个Thrust的bug,还是我做错了什么?我在Ubuntu 10.10和CUDA 4.0以及Windows 7和CUDA 6.5上尝试过。在这两种情况下,Thrust版本都是1.7。谢谢。
#include <thrust/device_vector.h>
thrust::device_vector<float4> v;
int main(){
v.resize(1000);
return 0;
}
错误信息如下:
terminate called after throwing an instance of 'thrust::system::system_error'
what(): unspecified driver error
如果我使用host_vector而不是device_vector,代码就可以正常运行。你觉得这是一个Thrust的bug,还是我做错了什么?我在Ubuntu 10.10和CUDA 4.0以及Windows 7和CUDA 6.5上尝试过。在这两种情况下,Thrust版本都是1.7。谢谢。