Version: v0.2.5 Latest Latest

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

Go to latest
Published: Jul 3, 2021 License: Apache-2.0 Imports: 7 Imported by: 0




View Source
const DefaultStrategy = BinaryTreeStar


This section is empty.


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.


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

type PartitionFunc added in v0.2.3

type PartitionFunc func(r plan.Interval, k int) []plan.Interval

partitionFunc is the signature of function that parts the interval

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) AsF64 added in v0.2.3

func (b *Vector) AsF64() []float64

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

type Workspace added in v0.2.3

type Workspace struct {
	SendBuf *Vector
	RecvBuf *Vector // if RecvBuf == SendBuf, will perform inplace operation
	OP      OP
	Name    string

Workspace contains the data that a Kungfu operation will be performed on.

func (Workspace) Forward added in v0.2.3

func (w Workspace) Forward()

func (Workspace) IsEmpty added in v0.2.3

func (w Workspace) IsEmpty() bool

func (Workspace) IsInplace added in v0.2.3

func (w Workspace) IsInplace() bool

func (Workspace) Split added in v0.2.3

func (w Workspace) Split(p PartitionFunc, k int) []Workspace

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL