Expand description
WebGPU backend: device context, buffer management, pipeline cache, and kernel dispatch. Production backend of Forge; the CPU backend is the numerical reference.
Modules§
- ops
- GPU op wrappers: bind tensors, compute grid sizes, dispatch WGSL kernels.
Semantics mirror
backend::cpuexactly; see the shader sources for the kernel-side contracts.
Structs§
- Dispatch
Scope - An open recording scope: every dispatch made while one is alive goes into a
single command encoder and a single
queue.submit. - Pooled
Buffer - A storage buffer that returns to its context’s free list when dropped rather than being destroyed.
- Stats
- Cumulative device counters, read with
WgpuContext::stats. - Wgpu
Context - Owns the wgpu device/queue and a cache of compiled compute pipelines.
Constants§
- OFFSET_
ALIGN_ BYTES - Storage-buffer offsets must respect this alignment when creating views.
Functions§
- linear_
grid - Split a linear element count into a (x, y, 1) workgroup grid of 256-thread groups, respecting the 65535 per-dimension dispatch limit.