base

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultStrategy = BinaryTreeStar

Variables

This section is empty.

Functions

func StrategyNames

func StrategyNames() []string

func Transform

func Transform(y, x *Vector, op OP)

Transform performs y[i] += x[i] for vectors y and x

func Transform2

func Transform2(z, x, y *Vector, op OP)

Transform2 performs z[i] = x[i] + y[i] for vectors z and x, y.

Types

type DataType

type DataType C.KungFu_Datatype

func (DataType) Size

func (t DataType) Size() int

func (DataType) String

func (t DataType) String() string

type OP

type OP C.KungFu_Op
const (
	SUM  OP = C.KungFu_SUM
	MIN  OP = C.KungFu_MIN
	MAX  OP = C.KungFu_MAX
	PROD OP = C.KungFu_PROD
)

type Strategy

type Strategy C.KungFu_Strategy

func ParseStrategy

func ParseStrategy(s string) (*Strategy, error)

func (*Strategy) Set

func (s *Strategy) Set(val string) error

Set implements flags.Value::Set

func (Strategy) String

func (s Strategy) String() string

type Vector

type Vector struct {
	Data  []byte
	Count int
	Type  DataType
}

func NewVector

func NewVector(count int, dtype DataType) *Vector

func (*Vector) AsF32

func (b *Vector) AsF32() []float32

func (*Vector) AsI32

func (b *Vector) AsI32() []int32

func (*Vector) AsI64

func (b *Vector) AsI64() []int64

func (*Vector) AsI8

func (b *Vector) AsI8() []int8

func (*Vector) CopyFrom

func (b *Vector) CopyFrom(c *Vector)

func (*Vector) Slice

func (b *Vector) Slice(begin, end int) *Vector

Slice returns a new Vector that points to a subset of the original Vector. 0 <= begin < end <= count - 1

Jump to

Keyboard shortcuts

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