shapes_go_gx

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Overview

Package shapes_go_gx are Go bindings to the GX package: shapes.

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 DType

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

DType stores the handle of DType on a backend.

func (*DType) Bridge

func (val *DType) Bridge() types.Bridge

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

func (DType) String

func (val DType) 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) NewDType

func (fac *Factory) NewDType() *DType

NewDType returns a handle on named type DType.

func (*Factory) NewShape

func (fac *Factory) NewShape() *Shape

NewShape returns a handle on named type Shape.

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 shapes 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) MarshalDType

func (cmpl *Package) MarshalDType(val values.Value) (s *DType, err error)

MarshalDType populates the receiver fields with device handles.

func (*Package) MarshalShape

func (cmpl *Package) MarshalShape(val values.Value) (s *Shape, err error)

MarshalShape 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 Shape

type Shape struct {
	DType *DType

	Dimensions *types.Slice[types.Atom[ir.Int]]
	// contains filtered or unexported fields
}

Shape stores the handle of Shape on a device.

func (*Shape) Bridge

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

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

func (Shape) String

func (s Shape) String() string

Jump to

Keyboard shortcuts

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