Expand description
§SimdQuickHeap: A fast SIMD-based priority queue
Just use the SimdQuickHeap type and it’s default, push, and pop functions.
This is a min-queue, so pop returns the smallest element in the queue.
The ConfigurableSimdQuickHeap type is mostly for benchmarking only, to test various parameters.
By default, it uses AVX2, or AVX-512 when available during compile time.
To force one or the other, use SimdQuickHeap<T, Avx2> or SimdQuickHeap<T, Avx512>.
§Example
let mut q = quickheap::SimdQuickHeap::<u64>::default();
q.push(4);
q.push(1);
q.push(7);
assert_eq!(q.pop(), Some(1));
q.push(7);
q.push(3);
assert_eq!(q.pop(), Some(3));
assert_eq!(q.pop(), Some(4));
assert_eq!(q.pop(), Some(7));
assert_eq!(q.pop(), Some(7));
assert_eq!(q.pop(), None);Structs§
- Avx2
- Marker type selecting the AVX2 (256-bit) SIMD backend for
ConfigurableSimdQuickHeap. - Avx512
- Marker type selecting the AVX-512 (512-bit) SIMD backend for
ConfigurableSimdQuickHeap. - Configurable
Simd Quick Heap - The full SimdQuickHeap implementation, with all configuration parameters.
Traits§
Type Aliases§
- Simd
- Tag to use with
ConfigurableSimdQuickHeapto use AVX-512 if it is available. - Simd
Quick Heap - A SIMD-based priority queue. Entrypoint of the crate.