我收到一条烦人的消息,我不太确定我做错了什么。
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 计算工具包\cuda\v4.0\include\thrust\detail\device\generic\extrema.inl(104): 错误:无法调用函数“equalOperator::operator()”使用给定的参数列表
谢谢!