Expand description
Zero-overhead SIMD function dispatch.
This module provides a thin wrapper around simd_native functions,
offering a stable public API while simd_native handles the
architecture-specific SIMD implementations internally.
§EPIC-C.2: TS-SIMD-002
Structs§
- Simd
Features - Information about available SIMD features.
Constants§
- CACHE_
LINE_ SIZE - Cache line size in bytes (standard for modern x86/ARM CPUs).
- PREFETCH_
DISTANCE_ 384D - Prefetch distance for 384-dimensional vectors.
- PREFETCH_
DISTANCE_ 768D - Prefetch distance for 768-dimensional vectors (3072 bytes).
Calculated at compile time:
768 * 4 / 64 = 48cache lines. - PREFETCH_
DISTANCE_ 1536D - Prefetch distance for 1536-dimensional vectors.
Functions§
- cosine_
dispatched - Compute cosine similarity with automatic SIMD dispatch.
- cosine_
normalized_ dispatched - Compute cosine similarity for pre-normalized vectors.
- dot_
product_ dispatched - Compute dot product with automatic SIMD dispatch.
- euclidean_
dispatched - Compute Euclidean distance with automatic SIMD dispatch.
- hamming_
dispatched - Compute Hamming distance with automatic SIMD dispatch.
- prefetch_
distance - Calculates prefetch distance for a given dimension at compile time.
- simd_
features_ info - Returns information about which SIMD features are available.