simd

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AvgAbsDiff512

func AvgAbsDiff512(a, b *Vec512) float32

AvgAbsDiff512 returns the average absolute difference across 512 dims as float32

func Cosine512

func Cosine512(a, b *Vec512, scaleA, scaleB float32) float32

Cosine computes cosine similarity between normalized int8 vectors Assumes vectors are pre-normalized and quantized

func Dot512

func Dot512(a, b *Vec512) int32

Dot512 returns the dot product of two 512-d int8 vectors with runtime dispatch

func DotN

func DotN(a, b []int8) int32

DotN computes dot product for arbitrary length int8 vectors

func L2Squared512

func L2Squared512(a, b *Vec512) int32

L2Squared512 computes squared L2 distance between int8 vectors (optimized)

func SumAbsDiff512

func SumAbsDiff512(a, b *Vec512) int32

SumAbsDiff512 computes sum of absolute differences (L1) between two int8 vectors (512-d) Returns the total L1 distance as int32.

Types

type Vec512

type Vec512 [512]int8

Vec512 represents a 512-dimensional int8 vector

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL