This question already has an answer here:
I copied this code from the Thrust documentation:
#include <thrust/copy.h>
#include <thrust/device_vector.h>
#include <thrust/host_vector.h>
int main()
{
thrust::device_vector<int> vec0(100);
thrust::device_vector<int> vec1(100);
thrust::copy(vec0.begin(), vec0.end(), vec1.begin());
return 0;
}
When I run this in Debug mode (VS2012), my program crashes and I get the error Debug Error! ... R6010 - abort() has been called.
When I run this in Release mode, it still crashes and I get the message .exe has stopped working
.
However copying from host-to-device works correctly:
thrust::host_vector<int> vec0(100);
thrust::device_vector<int> vec1(100);
thrust::copy(vec0.begin(), vec0.end(), vec1.begin());
I use GeForce GTX 970, CUDA driver version/runtime version is 7.5, deviceQuery runs without any problem. Host runtime library is in Multi-threaded (/MT)
mode. Does anybody have an idea what might cause this problem?
There are a few similar questions e.g. here
To quote a comment :
And from the docs: