Skip to main content

Module simd_dispatch

Module simd_dispatch 

Source
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§

SimdFeatures
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 = 48 cache 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.