Skip to main content

Crate quickheap

Crate quickheap 

Source
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.
ConfigurableSimdQuickHeap
The full SimdQuickHeap implementation, with all configuration parameters.

Traits§

SimdElem
The SIMD tag (Avx2 or Avx512) must implement SimdElem<T>.

Type Aliases§

Simd
Tag to use with ConfigurableSimdQuickHeap to use AVX-512 if it is available.
SimdQuickHeap
A SIMD-based priority queue. Entrypoint of the crate.