model

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompileWithStats

func CompileWithStats(CompileOptions) (*Kernel, CompileStats, error)

func CopyOutputChannelsToInput

func CopyOutputChannelsToInput(*Kernel, int, int, *Kernel, int, int, int) error

func CopyOutputRangeToInput

func CopyOutputRangeToInput(*Kernel, int, int, int, *Kernel, int, int, int, int, int) error

Types

type CompileOptions

type CompileOptions struct {
	MILText       string
	WeightBlob    []byte
	WeightPath    string
	WeightFiles   []WeightFile
	PackagePath   string
	ModelKey      string
	SharedModel   bool
	QoS           uint32
	PerfStatsMask uint32
}

type CompileStats

type CompileStats struct {
	CompileNS int64
	LoadNS    int64
	TotalNS   int64
}

type EvalStats

type EvalStats struct {
	HWExecutionNS uint64
	Metrics       map[string]float64
}

type Kernel

type Kernel struct{}

func Compile

func Compile(CompileOptions) (*Kernel, error)

func (*Kernel) Close

func (k *Kernel) Close()

func (*Kernel) Diagnostics

func (k *Kernel) Diagnostics() xanetelemetry.Diagnostics

func (*Kernel) Eval

func (k *Kernel) Eval() error

func (*Kernel) EvalBidirectional

func (k *Kernel) EvalBidirectional(uint32, uint64, uint32, uint64, xane.SharedEventEvalOptions) error

func (*Kernel) EvalHWExecutionNS

func (k *Kernel) EvalHWExecutionNS() (uint64, error)

func (*Kernel) EvalWithSignalEvent

func (k *Kernel) EvalWithSignalEvent(uint32, uint64, xane.SharedEventEvalOptions) error

func (*Kernel) EvalWithStats

func (k *Kernel) EvalWithStats() (EvalStats, error)

func (*Kernel) InputBytes

func (k *Kernel) InputBytes(int) int

func (*Kernel) InputLayout

func (k *Kernel) InputLayout(int) xane.TensorLayout

func (*Kernel) InputSurface

func (k *Kernel) InputSurface(int) coregraphics.IOSurfaceRef

func (*Kernel) Model added in v0.3.3

func (k *Kernel) Model() *xane.Model

func (*Kernel) NewRequestPool added in v0.3.4

func (k *Kernel) NewRequestPool(int) (*KernelRequestPool, error)

func (*Kernel) NumInputs

func (k *Kernel) NumInputs() int

func (*Kernel) NumOutputs

func (k *Kernel) NumOutputs() int

func (*Kernel) OutputBytes

func (k *Kernel) OutputBytes(int) int

func (*Kernel) OutputLayout

func (k *Kernel) OutputLayout(int) xane.TensorLayout

func (*Kernel) OutputSurface

func (k *Kernel) OutputSurface(int) coregraphics.IOSurfaceRef

func (*Kernel) ReadOutput

func (k *Kernel) ReadOutput(int, []byte) error

func (*Kernel) ReadOutputF32

func (k *Kernel) ReadOutputF32(int, []float32) error

func (*Kernel) ReadOutputFP16

func (k *Kernel) ReadOutputFP16(int, []float32) error

func (*Kernel) ReadOutputFP16Channels

func (k *Kernel) ReadOutputFP16Channels(int, int, []float32) error

func (*Kernel) WithLockedInput added in v0.3.4

func (k *Kernel) WithLockedInput(int, func(xane.TensorLayout, []byte) error) error

func (*Kernel) WithLockedOutput added in v0.3.4

func (k *Kernel) WithLockedOutput(int, func(xane.TensorLayout, []byte) error) error

func (*Kernel) WriteInput

func (k *Kernel) WriteInput(int, []byte) error

func (*Kernel) WriteInputF32

func (k *Kernel) WriteInputF32(int, []float32) error

func (*Kernel) WriteInputFP16

func (k *Kernel) WriteInputFP16(int, []float32) error

func (*Kernel) WriteInputFP16Channels

func (k *Kernel) WriteInputFP16Channels(int, int, []float32) error

type KernelPooledRequest added in v0.3.4

type KernelPooledRequest struct{}

func (*KernelPooledRequest) Eval added in v0.3.4

func (r *KernelPooledRequest) Eval() error

func (*KernelPooledRequest) Release added in v0.3.4

func (r *KernelPooledRequest) Release()

type KernelRequestPool added in v0.3.4

type KernelRequestPool struct{}

func (*KernelRequestPool) Acquire added in v0.3.4

func (p *KernelRequestPool) Acquire() *KernelPooledRequest

func (*KernelRequestPool) Close added in v0.3.4

func (p *KernelRequestPool) Close() error

type WeightFile

type WeightFile struct {
	Path string
	Blob []byte
}

Jump to

Keyboard shortcuts

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