我收到了一个烦人的消息,但我不确定自己做错了什么。
float4 *IntsOnHost = new float4[ MAXX * (MAXY - 1) ];
//copy possible intersection points from device to host
CU_SAFE_CALL(cudaMemcpy(IntsOnHost,IntsOnDevToCpyToHost,(MAXX*(MAXY - 1)-1)*sizeof(float4),cudaMemcpyDeviceToHost));
thrust::device_vector<float4> IntsOnDev (IntsOnHost,IntsOnHost + (MAXX * (MAXY - 1)-1)*sizeof(float4));
//find the index of the smallest intersection point
thrust::device_vector<float4>::iterator it = thrust::min_element(IntsOnDev.begin(),IntsOnDev.end(),equalOperator());
以及谓词:
struct equalOperator
{
__host__ __device__
bool operator()(float4 x, float4 y)
{
return ( x.w > y.w );
}
};
错误信息:
1>c:\program files\nvidia gpu computing toolkit\cuda\v4.0\include\thrust\detail\device\generic\extrema.inl(104): 错误:无法使用给定的参数列表调用函数“equalOperator::operator()”
谢谢!