Hello Everyone,
I am trying to build a program which develops a vector of vectors using Thrust in CUDA.
I managed to build the vector of vectors but now i cannot figure out how to manipulate each element separately within that.
Following is my code :
thrust::device_vector<thrust::device_vector<float> > Vec(4);
for(int i=0;i<Vec.size();i++)
{
Vec.push_back(thrust::device_vector<float>(5,6));
}
for(int i=0;i<Vec.size();i++)
{
for(int j=0;j<5;j++)
{
std::cout<<Vec[i][j]; //This line gives an error
}
}
Error: No operator “” matches these operands
I would like to know how to access each element separatly within this vector of vectors now.
Thank You.