floats

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const AVX512 = AVX | FMA | AVX512F

Variables

This section is empty.

Functions

func Add

func Add(dst, s []float32)

Add two vectors: dst = dst + s

func AddConst

func AddConst(dst []float32, c float32)

func AddTo

func AddTo(a, b, dst []float32)

AddTo adds two vectors and saves the result in dst: dst = a + b

func Div

func Div(dst, s []float32)

Div one vectors by another: dst = dst / s

func DivTo

func DivTo(a, b, c []float32)

func Dot

func Dot(a, b []float32) (ret float32)

Dot two vectors.

func Euclidean

func Euclidean(a, b []float32) float32

func MM

func MM(transA, transB bool, m, n, k int, a []float32, lda int, b []float32, ldb int, c []float32, ldc int)

func MatZero

func MatZero(x [][]float32)

MatZero fills zeros in a matrix of 32-bit floats.

func MulAddTo

func MulAddTo(a, b, c []float32)

MulAddTo multiplies a vector and a vector, then adds to a vector: c += a * b

func MulConst

func MulConst(dst []float32, c float32)

MulConst multiplies a vector with a const: dst = dst * c

func MulConstAdd

func MulConstAdd(a []float32, c float32, dst []float32)

MulConstAddTo multiplies a vector and a const, then adds to dst: dst = dst + a * c

func MulConstAddTo

func MulConstAddTo(a []float32, c float32, b, dst []float32)

func MulConstTo

func MulConstTo(a []float32, c float32, dst []float32)

MulConstTo multiplies a vector and a const, then saves the result in dst: dst = a * c

func MulTo

func MulTo(a, b, c []float32)

func Sqrt

func Sqrt(a []float32)

func SqrtTo

func SqrtTo(a, b []float32)

func Sub

func Sub(dst, s []float32)

Sub one vector by another: dst = dst - s

func SubTo

func SubTo(a, b, dst []float32)

SubTo subtracts one vector by another and saves the result in dst: dst = a - b

func Zero

func Zero(a []float32)

Zero fills zeros in a slice of 32-bit floats.

Types

type Feature

type Feature uint64
const (
	AVX Feature = 1 << iota
	FMA
	AVX512F
	CUDA
	MKL
	OPENBLAS
)

func (Feature) String

func (feature Feature) String() string

Jump to

Keyboard shortcuts

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