Hi! code as below.
int i = 0;
size_t n = 100;
std::vector<float> h_data(n);
for(i = 0; i < n; ++i) h_data[i] = i;
thrust::device_vector<float> d_data;
d_data.resize(h_data.size());
thrust::copy(thrust::device_pointer_cast(&h_data[0]),
thrust::device_pointer_cast(&h_data[0]) + h_data.size(),
d_data.begin());
std::cout << "start: " << thrust::device_pointer_cast(&h_data[0])
<< std::endl;
std::cout << "end: " << h_data.size() << std::endl;
std::cout << "end: " <<
thrust::device_pointer_cast(&h_data[0]) + h_data.size()
<< std::endl;
for(i = 0; i < n; ++i)
std::cout << i << " is " << d_data[i] << std::endl;
It works in GTX1080, but failed in Xavier, error info as below.
Please someone HELP! Thanks a lot!
start: 0x556ad7f6e0
end: 100
end: 0x556ad7f870
terminate called after throwing an instance of 'thrust::system::system_error'
what(): trivial_device_copy D->H failed: unspecified launch failure
Aborted (core dumped)