我想一次性转换值并对其进行排序,如下所示:
thrust::vector<int> dataIn = ...
thrust::vector<int> dataOut = ...
auto iterIn = cub::TransformInputIterator<int, Ftor, int*>(dataIn.begin(), Ftor());
cub::DeviceRadixSort::SortKeys(dTemp, tempBytes, iterIn, dataOut.begin(), numElems);
但是,SortKeys 需要原始指针而不是迭代器。尽管如此,是否有可能使用迭代器来完成这项工作?我知道这可以通过推力实现,但我想使用 CUB。
感谢您的建议。