Struct std::WebGpuBackend
struct WebGpuBackend { }Handles are byte offsets into the backend's one device heap (never 0), with device.h's element-type tag in the top bits.
Methods
No wait: the queue runs in order, so work that still reads the block runs before anything a new owner queues.
n 32-bit words, bit-exact (wk_copy: WebGPU copies within one buffer only through a kernel)
static int gemm(
int ta,
int tb,
unsigned long m,
unsigned long n,
unsigned long k,
float alpha,
unsigned long a,
unsigned long lda,
unsigned long b,
unsigned long ldb,
float beta,
unsigned long c,
unsigned long ldc,
)source · definitionConvolutions as implicit GEMMs (device_kernels.wgsl's wk_conv): the forward pass, the input gradient as a gather over the windows (no atomics), the weight gradient split over batch x pixels and added atomically into zeroed weights (fp32 only: a 16-bit one declines and device.sc runs it in fp32). A transposed convolution is the plain one with input and output swapped, so its forward pass is the input-gradient kernel and its input gradient the forward one; the input gradient runs a grid slice per stride phase, as Metal's does. The tile, by the product's rows (output channels, or input channels for the input gradient): 64 x 64 from 48, 32 x 128 from 17, 16 x 256 below.
static int map(
int op,
unsigned long a,
unsigned long b,
unsigned long out,
unsigned long n,
)source · definitiongpu_webgpu.h's elementwise ops without a DK_* kernel (device_kernels.wgsl's wk_map): out = a / b (op 0), pow(a, b) (1), sqrt(a) (2) over n elements