![]() |
Signet Forge 0.1.0
C++20 Parquet library with AI-native extensions
|
DEMO |
Platform-optimized SIMD routines for common vector operations. More...
Functions | |
| float | dot_product (const float *a, const float *b, size_t n) noexcept |
| Compute the dot product (inner product) of two float vectors. | |
| float | l2_distance_sq (const float *a, const float *b, size_t n) noexcept |
| Compute the squared L2 (Euclidean) distance between two float vectors. | |
| float | sum_of_squares (const float *data, size_t n) noexcept |
| Compute the sum of squares of a float vector. | |
| void | l2_normalize (float *data, size_t n) noexcept |
| L2-normalize a float vector in-place (divide each element by the L2 norm). | |
| void | copy_floats (float *dst, const float *src, size_t n) noexcept |
| Fast copy of n floats from src to dst. | |
Platform-optimized SIMD routines for common vector operations.
Compile-time dispatch: AVX2 → 8-wide float (256-bit) using mm256* SSE4_2 / SSE2 → 4-wide float (128-bit) using mm* __ARM_NEON → 4-wide float (128-bit) using NEON intrinsics fallback → scalar loop
All functions accept unaligned pointers and handle tail elements correctly.
|
inlinenoexcept |
Fast copy of n floats from src to dst.
Uses SIMD stores/loads when available for bandwidth. Handles unaligned pointers and non-multiple-of-SIMD-width sizes correctly.
| dst | Destination (n floats). |
| src | Source (n floats). |
| n | Number of floats to copy. |
Definition at line 736 of file vector_type.hpp.
|
inlinenoexcept |
Compute the dot product (inner product) of two float vectors.
| a | First vector (n elements). |
| b | Second vector (n elements). |
| n | Number of elements. |
Definition at line 509 of file vector_type.hpp.
|
inlinenoexcept |
Compute the squared L2 (Euclidean) distance between two float vectors.
| a | First vector (n elements). |
| b | Second vector (n elements). |
| n | Number of elements. |
Definition at line 572 of file vector_type.hpp.
|
inlinenoexcept |
L2-normalize a float vector in-place (divide each element by the L2 norm).
If the vector has zero norm (all zeros), it is left unchanged.
| data | Vector to normalize (n elements, modified in-place). |
| n | Number of elements. |
Definition at line 690 of file vector_type.hpp.
|
inlinenoexcept |
Compute the sum of squares of a float vector.
| data | Input vector (n elements). |
| n | Number of elements. |
Definition at line 634 of file vector_type.hpp.