Documentation ¶
Index ¶
- func FormatFloat32(x float64) string
- func FormatScalar(x backends.Value) string
- type Code
- type FloatSymbol
- type Generator
- type GeneratorBase
- func (b *GeneratorBase) AddGlobalObject(obj GlobalObject)
- func (b *GeneratorBase) DeclareGlobalObjects()
- func (b *GeneratorBase) DeviceChunks() []string
- func (b *GeneratorBase) EndCode()
- func (b *GeneratorBase) EnterInit()
- func (b *GeneratorBase) EnterKernel()
- func (b *GeneratorBase) EnterProlog()
- func (b *GeneratorBase) ExitInit()
- func (b *GeneratorBase) ExitKernel()
- func (b *GeneratorBase) ExitProlog()
- func (b *GeneratorBase) GetCode() *Code
- func (b *GeneratorBase) HostChunks() []string
- func (b *GeneratorBase) Indent(delta int)
- func (b *GeneratorBase) Init(self Generator, rngSeed int, defaultDtype base.Dtype, ...)
- func (b *GeneratorBase) InitializeGlobalObjects()
- func (b *GeneratorBase) MakeFloatSymbol() *FloatSymbol
- func (b *GeneratorBase) MakeIndex(name string) int
- func (b *GeneratorBase) MakeIntSymbol() *IntSymbol
- func (b *GeneratorBase) PopCode()
- func (b *GeneratorBase) PushCode()
- func (b *GeneratorBase) StartCode()
- func (b *GeneratorBase) WriteChunk(chunk string)
- func (b *GeneratorBase) WriteLine(s string, args ...interface{})
- type GlobalObject
- type IntSymbol
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatFloat32 ¶
func FormatScalar ¶
Types ¶
type Code ¶
type Code struct {
// contains filtered or unexported fields
}
func (*Code) WriteChunk ¶
type FloatSymbol ¶
func NewFloatSymbol ¶
func NewFloatSymbol(s string) *FloatSymbol
func (*FloatSymbol) String ¶
func (x *FloatSymbol) String() string
func (*FloatSymbol) Symbol ¶
func (x *FloatSymbol) Symbol() string
type Generator ¶
type Generator interface { backends.Backend HostChunks() []string DeviceChunks() []string StartCode() EndCode() PushCode() PopCode() GetCode() *Code WriteLine(s string, args ...interface{}) WriteChunk(chunk string) Indent(delta int) EnterInit() ExitInit() AddGlobalObject(obj GlobalObject) BuildProlog() MakeIndex(name string) int MakeIntSymbol() *IntSymbol MakeFloatSymbol() *FloatSymbol // following methods must be overriden GetData(dest string, start string, stop string, x backends.Tensor) string GetMetricSum(x backends.Tensor, start string, stop string) string OutputCode(outDir string) error FormatBufferRef(tensor backends.Tensor, paren bool) string }
type GeneratorBase ¶
type GeneratorBase struct { backends.BackendBase // contains filtered or unexported fields }
func (*GeneratorBase) AddGlobalObject ¶
func (b *GeneratorBase) AddGlobalObject(obj GlobalObject)
func (*GeneratorBase) DeclareGlobalObjects ¶
func (b *GeneratorBase) DeclareGlobalObjects()
func (*GeneratorBase) DeviceChunks ¶
func (b *GeneratorBase) DeviceChunks() []string
func (*GeneratorBase) EndCode ¶
func (b *GeneratorBase) EndCode()
func (*GeneratorBase) EnterInit ¶
func (b *GeneratorBase) EnterInit()
func (*GeneratorBase) EnterKernel ¶
func (b *GeneratorBase) EnterKernel()
func (*GeneratorBase) EnterProlog ¶
func (b *GeneratorBase) EnterProlog()
func (*GeneratorBase) ExitInit ¶
func (b *GeneratorBase) ExitInit()
func (*GeneratorBase) ExitKernel ¶
func (b *GeneratorBase) ExitKernel()
func (*GeneratorBase) ExitProlog ¶
func (b *GeneratorBase) ExitProlog()
func (*GeneratorBase) GetCode ¶
func (b *GeneratorBase) GetCode() *Code
func (*GeneratorBase) HostChunks ¶
func (b *GeneratorBase) HostChunks() []string
func (*GeneratorBase) Indent ¶
func (b *GeneratorBase) Indent(delta int)
func (*GeneratorBase) Init ¶
func (b *GeneratorBase) Init( self Generator, rngSeed int, defaultDtype base.Dtype, compatMode backends.CompatMode)
func (*GeneratorBase) InitializeGlobalObjects ¶
func (b *GeneratorBase) InitializeGlobalObjects()
func (*GeneratorBase) MakeFloatSymbol ¶
func (b *GeneratorBase) MakeFloatSymbol() *FloatSymbol
func (*GeneratorBase) MakeIndex ¶
func (b *GeneratorBase) MakeIndex(name string) int
func (*GeneratorBase) MakeIntSymbol ¶
func (b *GeneratorBase) MakeIntSymbol() *IntSymbol
func (*GeneratorBase) PopCode ¶
func (b *GeneratorBase) PopCode()
func (*GeneratorBase) PushCode ¶
func (b *GeneratorBase) PushCode()
func (*GeneratorBase) StartCode ¶
func (b *GeneratorBase) StartCode()
func (*GeneratorBase) WriteChunk ¶
func (b *GeneratorBase) WriteChunk(chunk string)
func (*GeneratorBase) WriteLine ¶
func (b *GeneratorBase) WriteLine(s string, args ...interface{})
type GlobalObject ¶
type GlobalObject interface { Declare() Initialize() }
type IntSymbol ¶
func NewIntSymbol ¶
Click to show internal directories.
Click to hide internal directories.