processor

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package processor stores processing that is required before and after a compiled function is called.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Argument

type Argument interface {
	ir.Element

	Shape() *shape.Shape

	ToDeviceHandle(platform.Device, *values.FuncInputs) (platform.DeviceHandle, error)
}

Argument provides an argument to pass to the backend.

type Initializer

type Initializer interface {
	Init(*values.FuncInputs) error
}

Initializer is called at the beginning of a run before arguments for the backend are computed.

type Processor

type Processor struct {
	// contains filtered or unexported fields
}

Processor stores initializers and traces to process before and after calling a compiled function.

func (*Processor) Args

func (p *Processor) Args() []Argument

Args returns the graph arguments.

func (*Processor) ElementArgs added in v0.3.0

func (p *Processor) ElementArgs() []ir.Element

ElementArgs returns the graph arguments as interpreter elements.

func (*Processor) Inits

func (p *Processor) Inits() []Initializer

Inits returns all the initializers.

func (*Processor) ProcessInits

func (p *Processor) ProcessInits(fc *values.FuncInputs) error

ProcessInits calls all the initializers callbacks.

func (*Processor) ProcessTraces

func (ts *Processor) ProcessTraces(dev platform.Device, in *values.FuncInputs, tracer trace.Callback, aux []platform.DeviceHandle) error

ProcessTraces processes the graph outputs related to traces.

func (*Processor) RegisterArg

func (p *Processor) RegisterArg(arg Argument) int

RegisterArg an argument for the backend. Returns the index of the argument.

func (*Processor) RegisterInit

func (p *Processor) RegisterInit(init Initializer)

RegisterInit registers an Initializer to the graph.

func (*Processor) RegisterTrace

func (ts *Processor) RegisterTrace(ctx ir.Evaluator, call *ir.CallExpr, args []ir.Element) error

RegisterTrace registers a call to the trace builtin.

func (*Processor) Traces

func (ts *Processor) Traces() []ir.Element

Traces returns a tuple of all the trace nodes.

Jump to

Keyboard shortcuts

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