Documentation
¶
Overview ¶
Package processor stores processing that is required before and after a compiled function is called.
Index ¶
- type Argument
- type Initializer
- type Processor
- func (p *Processor) Args() []Argument
- func (p *Processor) ElementArgs() []ir.Element
- func (p *Processor) Inits() []Initializer
- func (p *Processor) ProcessInits(fc *values.FuncInputs) error
- func (ts *Processor) ProcessTraces(dev platform.Device, in *values.FuncInputs, tracer trace.Callback, ...) error
- func (p *Processor) RegisterArg(arg Argument) int
- func (p *Processor) RegisterInit(init Initializer)
- func (ts *Processor) RegisterTrace(ctx ir.Evaluator, call *ir.CallExpr, args []ir.Element) error
- func (ts *Processor) Traces() []ir.Element
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) ElementArgs ¶ added in v0.3.0
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 ¶
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 ¶
RegisterTrace registers a call to the trace builtin.