Expand description
GPU-style parallel sorting algorithms (CPU simulation).
This module provides GPU-pattern algorithms for sorting and related
operations on f32/u32 data:
- Bitonic sort (power-of-2 padded)
- LSD radix sort for
u32andf32 - Exclusive prefix sum (Blelloch scan style)
- Parallel histogram
- Counting sort
- Morton Z-order sort for 3-D point clouds
GpuSortBuffer— key+value buffer withsort_pairs- Parallel merge
Structs§
- GpuSort
Buffer - A buffer abstraction that holds parallel key and value arrays.
Functions§
- bitonic_
sort - Sort a
Vecf32` in ascending order using the bitonic sort algorithm. - bitonic_
sort_ by_ key - Sort a
VecTby theu32key returned bykey_fn`. - counting_
sort - Counting sort for
u32values bounded bymax_val(inclusive). - histogram
- Compute a histogram of
datainton_binsequal-width bins over\[min_val, max_val). - morton_
sort_ 3d - Sort 3-D
f32points by their Morton Z-order (space-filling curve) code. - parallel_
merge - Merge two sorted
f32slices into a new sortedVecf32`. - prefix_
sum - Exclusive prefix sum (Blelloch scan) for
u32values. - radix_
sort_ f32 - Sort
f32values by reinterpreting bits and flipping the sign bit for negatives so that the full IEEE 754 ordering maps to unsigned integer order. - radix_
sort_ u32 - LSD radix sort for
u32using 4 passes of 8-bit digits.