I'm trying to pass device_vector
of structures
struct point
{
unsigned int x;
unsigned int y;
}
to a function in a following manner:
void print(thrust::device_vector<point> &points, unsigned int index)
{
std::cout << points[index].y << points[index].y << std::endl;
}
myvector was initialized properly
print(myvector, 0);
I get following errors:
error: class "thrust::device_reference<point>" has no member "x"
error: class "thrust::device_reference<point>" has no member "y"
What's wrong with it?
See Question&Answers more detail:os