Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cuda 由推力迭代器指向的打印值_Cuda_Gpu_Thrust - Fatal编程技术网

Cuda 由推力迭代器指向的打印值

Cuda 由推力迭代器指向的打印值,cuda,gpu,thrust,Cuda,Gpu,Thrust,请参阅以下代码: thrust::device_vector<int>::iterator whereToBegin = copyListOfNgramCounteachdoc.begin(); end = thrust::unique_by_key(end.first, end.first + numUniqueNgrams,end.second); thrust::device_vector<int>::iterator end1 = end.first; thrus

请参阅以下代码:

thrust::device_vector<int>::iterator whereToBegin = copyListOfNgramCounteachdoc.begin();
end = thrust::unique_by_key(end.first, end.first + numUniqueNgrams,end.second);
thrust::device_vector<int>::iterator end1 = end.first;
thrust::device_vector<int>::iterator iter;
for(iter = whereToBegin; iter!=end1; iter++){
    //PRINT VALUE POINTED AT BY ITERATOR
 }
推力::设备\向量::迭代器whereToBegin=copylistOfGramCounteAchDoc.begin();
end=推力::通过_键唯一_(end.first,end.first+numuniquegrams,end.second);
推力::设备\向量::迭代器end1=end.first;
推力::设备向量::迭代器iter;
用于(iter=whereToBegin;iter!=end1;iter++){
//迭代器指向的打印值
}
问题很简单。如何在主机代码中打印iter所指向的值:

std::cout << *iter << std::endl;
主机代码中的std::cout:

std::cout << *iter << std::endl;

std::谢谢。如果您也能看看我的问题推力::unique_by_key吃掉最后一个元素,并告诉我您是否看到任何有趣的东西,我将不胜感激。谢谢。如果你们也能看一下我的问题,我将不胜感激:独特的,按键的,吃掉最后一个元素,如果你们看到任何有趣的东西,请告诉我