cub
cub copied to clipboard
BlockRadixSort and arrangement of input data
Sorry if I'm missing the obvious point, but:
- The documentation for BlockRadixSort divides the sorting methods in purely "blocked arrangements" and "blocked arrangement -> striped arrangement".
- Another quote: "Performs an ascending block-wide radix sort over a blocked arrangement of keys."
- It even suggests how to get data in blocked arrangement by referring to "Consider variants of cub::BlockLoad for efficiently gathering a blocked arrangement of elements across threads." After reading all this I captured myself in doing a BlockExchange to go from striped to blocked. But wait.
It's obvious that we need to distinguish the output's arrangement. But why would we care about the input data's arrangement? There is no thing like "valid_items" where we'd need to care which ones are the first N items. All input items are sorted, thus if sorting works, the result is independant of the input arrangement.
So why does the documentation request a blocked arrangement?