我正在尝试传递device_vector
结构
struct point
{
unsigned int x;
unsigned int y;
}
以下列方式传递给函数:
void print(thrust::device_vector<point> &points, unsigned int index)
{
std::cout << points[index].y << points[index].y << std::endl;
}
myvector 已正确初始化
print(myvector, 0);
我收到以下错误:
error: class "thrust::device_reference<point>" has no member "x"
error: class "thrust::device_reference<point>" has no member "y"
它出什么问题了?