encoding_go_gx

package
v0.3.3 Latest Latest
Warning

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

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

Documentation

Overview

Package encoding_go_gx are Go bindings to the GX package: github.com/gx-org/gx/tests/bindings/encoding.

Automatically generated by gx/golang/binder/gobindings/bindings.go.tmpl.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arrays

type Arrays struct {
	ArrayF32 types.Array[float32]
	// contains filtered or unexported fields
}

Arrays stores the handle of Arrays on a device.

func (*Arrays) Bridge

func (s *Arrays) Bridge() types.Bridge

Bridge returns the bridge between the Go value and the GX value.

func (Arrays) String

func (s Arrays) String() string

type Encoding

type Encoding struct {
	Scalars *Scalars

	DataAsSlices *Arrays

	DataAsArrays *Arrays
	// contains filtered or unexported fields
}

Encoding stores the handle of Encoding on a device.

func (*Encoding) Bridge

func (s *Encoding) Bridge() types.Bridge

Bridge returns the bridge between the Go value and the GX value.

func (Encoding) String

func (s Encoding) String() string

type Factory

type Factory struct {
	Package *Package
}

Factory create new instance of types used in the package. The compiler associated with the factory defines on what device and with which options methods of the instances created by the factory are compiled for.

func (*Factory) NewArrays

func (fac *Factory) NewArrays() *Arrays

NewArrays returns a handle on named type Arrays.

func (*Factory) NewEncoding

func (fac *Factory) NewEncoding() *Encoding

NewEncoding returns a handle on named type Encoding.

func (*Factory) NewScalars

func (fac *Factory) NewScalars() *Scalars

NewScalars returns a handle on named type Scalars.

func (*Factory) NewSlice

func (fac *Factory) NewSlice() *Slice

NewSlice returns a handle on named type Slice.

type MethodScalarsGetTotal

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

MethodScalarsGetTotal compiles and runs the GX function GetTotal for a device. GetTotal returns the sum of all fields.

func (*MethodScalarsGetTotal) Run

func (f *MethodScalarsGetTotal) Run() (_ types.Atom[float32], err error)

Run first compiles GetTotal for a given device and the given arguments. Once compiled, the function is then run with these same arguments. If the shape of the arguments change, the function will panic.

func (*MethodScalarsGetTotal) String

func (f *MethodScalarsGetTotal) String() string

type Package

type Package struct {
	Package *PackageIR
	Device  *api.Device
	Factory *Factory
	// contains filtered or unexported fields
}

Package is a GX package for a given device. Functions and methods are compiled specifically for that device.

func BuildFor

func BuildFor(dev *api.Device, options ...options.PackageOptionFactory) (*Package, error)

BuildFor loads the GX package github.com/gx-org/gx/tests/bindings/encoding then returns that package for a given device and options.

func (*Package) AppendOptions

func (cmpl *Package) AppendOptions(options ...options.PackageOptionFactory)

AppendOptions appends options to the compiler.

func (*Package) MarshalArrays

func (cmpl *Package) MarshalArrays(val values.Value) (s *Arrays, err error)

MarshalArrays populates the receiver fields with device handles.

func (*Package) MarshalEncoding

func (cmpl *Package) MarshalEncoding(val values.Value) (s *Encoding, err error)

MarshalEncoding populates the receiver fields with device handles.

func (*Package) MarshalScalars

func (cmpl *Package) MarshalScalars(val values.Value) (s *Scalars, err error)

MarshalScalars populates the receiver fields with device handles.

func (*Package) MarshalSlice

func (cmpl *Package) MarshalSlice(val values.Value) (s *Slice, err error)

MarshalSlice populates the receiver fields with device handles.

type PackageIR

type PackageIR struct {
	Runtime *api.Runtime
	IR      *ir.Package
	Tracer  trace.Callback
}

PackageIR is the GX package intermediate representation built for a given runtime, but not yet for a specific device.

func Load

func Load(rtm *api.Runtime) (*PackageIR, error)

Load the GX package for a given backend.

func (*PackageIR) BuildFor

func (pkg *PackageIR) BuildFor(dev *api.Device, options ...options.PackageOptionFactory) *Package

BuildFor returns a package ready to compile for a device and options.

type Scalars

type Scalars struct {
	Int types.Atom[int32]

	Float32 types.Atom[float32]

	Float64 types.Atom[float64]
	// contains filtered or unexported fields
}

Scalars stores the handle of Scalars on a device.

func (*Scalars) Bridge

func (s *Scalars) Bridge() types.Bridge

Bridge returns the bridge between the Go value and the GX value.

func (Scalars) GetTotal

func (s Scalars) GetTotal() *MethodScalarsGetTotal

GetTotal returns a handle to compile method GetTotal for a device.

func (Scalars) String

func (s Scalars) String() string

type Slice

type Slice struct {
	Instance *Encoding

	Slice *types.Slice[*Encoding]
	// contains filtered or unexported fields
}

Slice stores the handle of Slice on a device.

func (*Slice) Bridge

func (s *Slice) Bridge() types.Bridge

Bridge returns the bridge between the Go value and the GX value.

func (Slice) String

func (s Slice) String() string

Jump to

Keyboard shortcuts

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