Documentation
¶
Index ¶
- Variables
- func DeltaPack(in []uint64) []byte
- func Names() []string
- func Register(name string, fn Runner)
- func Run(name string) error
- func VarintDecode(b []byte) (u uint64, n int)
- func VarintEncode(u uint64) []byte
- type AStarIn
- type AStarOut
- type AStarPod
- type AudioBuffer
- type CullingIn
- type CullingOut
- type CullingPod
- type ExecContext
- type Frustum
- type GEMMIn
- type GEMMOut
- type GEMMPod
- type GPUHooks
- type GridMap
- type ImageFrame
- type LayerNormIn
- type LayerNormOut
- type LayerNormPod
- type Mesh
- type Pod
- type Pool
- type RGBToYUVIn
- type RGBToYUVOut
- type RGBToYUVPod
- type ReduceIn
- type ReduceOut
- type ReducePod
- type Runner
- type STFTIn
- type STFTOut
- type STFTPod
- type ScanIn
- type ScanOut
- type ScanPod
- type SoftmaxIn
- type SoftmaxOut
- type SoftmaxPod
- type Tensor
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoGPU = errors.New("gpu unavailable (build with -tags=gpu to enable)")
Single canonical error used across CPU/GPU builds.
Functions ¶
func VarintDecode ¶
func VarintEncode ¶
Types ¶
type AudioBuffer ¶
type CullingOut ¶
type CullingOut struct{ Visible []bool }
type CullingPod ¶
type CullingPod struct{}
func (CullingPod) Name ¶
func (CullingPod) Name() string
func (CullingPod) Run ¶
func (CullingPod) Run(_ *ExecContext, in any) (any, error)
type ExecContext ¶
type ExecContext struct {
Ctx context.Context
UseGPU bool // high-level knob; pods may override per-op
Report *detector.Report // detector output (limits, features, recs)
GPU GPUHooks // nil unless -tags=gpu and initialized
TempPool *Pool // scratch buffers (optional)
Now time.Time
}
ExecContext carries execution choices and capabilities.
func NewContext ¶
func NewContext(rep *detector.Report) *ExecContext
func (*ExecContext) WithGPU ¶
func (ec *ExecContext) WithGPU(g GPUHooks) *ExecContext
type GPUHooks ¶
type GPUHooks interface {
DispatchScanU32(in []uint32, inclusive bool) ([]uint32, error)
DispatchReduceF32(in []float32, kind string) (float32, error) // kind: "sum"|"max"|"mean"
DispatchSoftmaxF32(in []float32) ([]float32, error)
}
GPUHooks describes the optional GPU backend. Keep it slice-based so CPU fallback is easy.
var GPU GPUHooks = noopGPU{}
Default to a no-op GPU so everything builds/runs without tags.
type ImageFrame ¶
type LayerNormIn ¶
type LayerNormOut ¶
type LayerNormOut struct{ Y []float32 } // per-vector LN; extend with shape later
type LayerNormPod ¶
type LayerNormPod struct{}
func (LayerNormPod) Name ¶
func (LayerNormPod) Name() string
func (LayerNormPod) Run ¶
func (LayerNormPod) Run(_ *ExecContext, in any) (any, error)
type Pod ¶
type Pod interface {
Name() string
Run(ctx *ExecContext, in any) (out any, err error)
}
Pod is a unit of work (scan, GEMM, culling, STFT, …).
type RGBToYUVIn ¶
type RGBToYUVIn struct {
Frame ImageFrame // Format "RGB"
}
type RGBToYUVOut ¶
type RGBToYUVOut struct {
Y, U, V []float32 // planar 4:4:4 for simplicity
}
type RGBToYUVPod ¶
type RGBToYUVPod struct{}
func (RGBToYUVPod) Name ¶
func (RGBToYUVPod) Name() string
func (RGBToYUVPod) Run ¶
func (RGBToYUVPod) Run(_ *ExecContext, in any) (any, error)
type STFTIn ¶
type STFTIn struct {
Audio AudioBuffer
WinSize int
Hop int
Window string // "hann" (default), …
}
type SoftmaxOut ¶
type SoftmaxOut struct{ Probs []float32 }
type SoftmaxPod ¶
type SoftmaxPod struct{}
func (SoftmaxPod) Name ¶
func (SoftmaxPod) Name() string
func (SoftmaxPod) Run ¶
func (SoftmaxPod) Run(x *ExecContext, in any) (any, error)
Click to show internal directories.
Click to hide internal directories.