Using device_vector:
thrust::device_vector< int > iVec;
int* iArray = thrust::raw_pointer_cast( &iVec[0] );
but how can I do it if I have an array of device_vectors?
thrust::device_vector<int> iVec[10];
Ideally I would like to pass my array of device_vector to a 1D array to be handled on a CUDA kernel. Is it possible?
If I have understood your question correctly, what you are really try to do is create an array of raw pointers from an array of
thrust::device_vectors. You should be able to do this like so:[disclaimer: written in browser, never compiled, never tested, use at own risk]
In the above code snippet,
_iRawholds the raw pointers of each of the device vectors iniVec. You could pass that to a kernel if you really wanted to.