即時通訊在這裏得到一個惱人的消息,我不太清楚即時通訊做錯了什麼。無法爲推力:: cuda min_element()函數建立一個比較謂詞
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:\程序文件\ NVIDIA圖形處理器計算 工具箱\ CUDA \ V4.0 \包括\推力\詳細\設備\通用\ extrema.inl(104): 錯誤:函數「equalOperator :: operator()」不能調用 給定的參數列表
謝謝!
你能添加什麼編譯器認爲該給予n參數列表是? – 2012-02-12 03:24:22