Template Function treeweave::guru::counting_sort

Function Documentation

template<std::ranges::contiguous_range In, std::ranges::contiguous_range Packed>
void treeweave::guru::counting_sort(std::span<const std::uint32_t> keys, In &&in, Packed &&packed, std::span<std::uint32_t> counts, std::span<std::uint32_t> rank)

One-shot convenience: histogram -> exclusive_scan -> scatter. On return counts[b] is the ending offset of bin b (feed to for_each_run), packed is the bin-ordered input, and rank[i] holds the packed slot of point i.