turbosort 0.1.1

SIMD-accelerated radix sort for primitive types
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Sorting networks for very small arrays (n ≤ 16).
//!
//! Dispatches to SIMD sorting networks when available (Phase 3),
//! falls back to insertion sort on scalar.

use crate::key::SortableKey;

/// Sort a slice of at most 16 elements.
///
/// # Panics
///
/// Debug-asserts that `slice.len() <= 16`.
#[inline]
pub fn sort<T: SortableKey>(slice: &mut [T]) {
    debug_assert!(slice.len() <= 16);
    crate::arch::sort_tiny(slice);
}