我正在尝试传递结构体的
以以下方式将参数传递给函数:
我遇到了以下错误:
这是什么问题?
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"
这是什么问题?
index
参数没有类型,应该改为int index
? - René Richter