I was using this vector of vector approach in CUDA since I am still used to Matlab and Python style programming environment. I was able to extract data from host side in the device vectors but now I am not sure how to access that data, for example, for printing. I tried using iterators but it I get error saying device_reference has no member "begin" or "end".
(Using VS 2010 with CUDA Toolkit 5.0)
thrust::device_vector<thrust::device_vector<int>> kmers;
//Do some stuff here to fill kmers
//
//
thrust::device_vector<thrust::device_vector<int>>::iterator ii;
thrust::device_vector<int>::iterator i;
for (ii = kmers.begin();ii!=kmers.end();++ii)
{
for (i = (*ii).begin(); i != (*ii).end(); i++){
std::cout << (*i) << "\n";
}
}
Any advice? Edit: I understand that thrust containers currently cannot be directly passed on to CUDA kernels. Are there any other libraries/containers which would allow me to do so?