avx

package module
v0.0.0-...-173aeef Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2018 License: MIT Imports: 4 Imported by: 0

README

go-avx Build Status

AVX(Advanced Vector Extensions) binding for golang.

Golang code example

package main

import (
	"fmt"

	avx "github.com/monochromegane/go-avx"
)

func main() {
	dim := 8
	x := avx.MmMalloc(dim)
	y := avx.MmMalloc(dim)
	z := avx.MmMalloc(dim)
	defer avx.MmFree(x)
	defer avx.MmFree(y)
	defer avx.MmFree(z)

	for i := 0; i < dim; i++ {
		x[i] = float32(i)
		y[i] = float32(i + 1)
	}

	avx.Add(dim, x, y, z)

	fmt.Printf("%v\n", z) // [1 3 5 7 9 11 13 15]
}

Features

  • Add
  • Sub
  • Mul
  • Dot
  • EuclideanDistance

See also avx_test.go.

License

MIT

Author

monochromegane

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(size int, x, y, z []float32)

func Dot

func Dot(size int, x, y []float32) float32

func EuclideanDistance

func EuclideanDistance(size int, x, y []float32) float32

func MmFree

func MmFree(v []float32)

func MmMalloc

func MmMalloc(size int) []float32

func Mul

func Mul(size int, x, y, z []float32)

func Sub

func Sub(size int, x, y, z []float32)

Types

This section is empty.

Jump to

Keyboard shortcuts

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