Skip to content

WasmGPU.compute

Summary

WasmGPU.compute is the instance-bound WebGPU compute surface. It creates buffers and pipelines, dispatches work, exposes CPU and GPU ndarray constructors, provides reusable readback resources, and owns the built-in compute-kernel library for the WasmGPU instance.

Canonical documentation namepaths keep directly traversable services and static members dotted, such as compute.kernels.* and compute.CPUndarray.fromArray, and use # for returned-object members, such as compute.CPUndarray#data and compute.createStorageBuffer#read.

Syntax

const compute = wgpu.compute;

compute is created with the WasmGPU instance and shares its GPUDevice and GPUQueue. Callers own resources returned by its creation methods; destroying the engine destroys the compute service itself but does not destroy caller-created buffers and pipelines.

Available APIs

See Also