Documentation
¶
Overview ¶
Package basic_go_gx are Go bindings to the GX package: github.com/gx-org/gx/tests/bindings/basic.
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 AddPrivate ¶
type AddPrivate struct {
// contains filtered or unexported fields
}
AddPrivate compiles and runs the GX function AddPrivate for a device. AddPrivate returns the sum of two private fields.
func (*AddPrivate) Run ¶
Run first compiles AddPrivate 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 (*AddPrivate) String ¶
func (f *AddPrivate) String() string
type Basic ¶
type Basic struct {
Int types.Atom[int32]
Float types.Atom[float32]
Array types.Array[float32]
// contains filtered or unexported fields
}
Basic stores the handle of Basic on a device.
func (Basic) AddPrivate ¶
func (s Basic) AddPrivate() *MethodBasicAddPrivate
AddPrivate returns a handle to compile method AddPrivate for a device.
func (Basic) SetFloat ¶
func (s Basic) SetFloat() *MethodBasicSetFloat
SetFloat returns a handle to compile method SetFloat for a device.
type Empty ¶
type Empty struct {
// contains filtered or unexported fields
}
Empty stores the handle of Empty on a device.
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.
type MethodBasicAddPrivate ¶
type MethodBasicAddPrivate struct {
// contains filtered or unexported fields
}
MethodBasicAddPrivate compiles and runs the GX function AddPrivate for a device. AddPrivate returns the sum of two private fields.
func (*MethodBasicAddPrivate) Run ¶
func (f *MethodBasicAddPrivate) Run() (_ types.Atom[int32], err error)
Run first compiles AddPrivate 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 (*MethodBasicAddPrivate) String ¶
func (f *MethodBasicAddPrivate) String() string
type MethodBasicSetFloat ¶
type MethodBasicSetFloat struct {
// contains filtered or unexported fields
}
MethodBasicSetFloat compiles and runs the GX function SetFloat for a device. SetFloat sets the Float field.
func (*MethodBasicSetFloat) Run ¶
Run first compiles SetFloat 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 (*MethodBasicSetFloat) String ¶
func (f *MethodBasicSetFloat) String() string
type New ¶
type New struct {
// contains filtered or unexported fields
}
New compiles and runs the GX function New for a device. New returns a new instance of the basic structure.
type Package ¶
type Package struct {
Package *PackageIR
Device *api.Device
Factory *Factory
ReturnFloat32 ReturnFloat32
ReturnArrayFloat32 ReturnArrayFloat32
ReturnMultiple ReturnMultiple
New New
AddPrivate AddPrivate
// 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 ¶
BuildFor loads the GX package github.com/gx-org/gx/tests/bindings/basic 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) MarshalBasic ¶
MarshalBasic populates the receiver fields with device handles.
type PackageIR ¶
PackageIR is the GX package intermediate representation built for a given runtime, but not yet for a specific device.
type ReturnArrayFloat32 ¶
type ReturnArrayFloat32 struct {
// contains filtered or unexported fields
}
ReturnArrayFloat32 compiles and runs the GX function ReturnArrayFloat32 for a device. ReturnArrayFloat32 returns a float32 tensor.
func (*ReturnArrayFloat32) Run ¶
func (f *ReturnArrayFloat32) Run() (_ types.Array[float32], err error)
Run first compiles ReturnArrayFloat32 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 (*ReturnArrayFloat32) String ¶
func (f *ReturnArrayFloat32) String() string
type ReturnFloat32 ¶
type ReturnFloat32 struct {
// contains filtered or unexported fields
}
ReturnFloat32 compiles and runs the GX function ReturnFloat32 for a device. ReturnFloat32 returns a float32.
func (*ReturnFloat32) Run ¶
func (f *ReturnFloat32) Run() (_ types.Atom[float32], err error)
Run first compiles ReturnFloat32 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 (*ReturnFloat32) String ¶
func (f *ReturnFloat32) String() string
type ReturnMultiple ¶
type ReturnMultiple struct {
// contains filtered or unexported fields
}
ReturnMultiple compiles and runs the GX function ReturnMultiple for a device. ReturnMultiple returns multiple values.
func (*ReturnMultiple) Run ¶
func (f *ReturnMultiple) Run() (_ types.Atom[int32], _ types.Atom[float32], _ types.Atom[float64], err error)
Run first compiles ReturnMultiple 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 (*ReturnMultiple) String ¶
func (f *ReturnMultiple) String() string