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¶
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¶
- compute.createStorageBuffer and compute.createUniformBuffer create GPU buffer wrappers.
- compute.createPipeline creates a compute pipeline for caller-authored WGSL.
- compute.dispatch and related helpers encode or submit compute work.
- compute.CPUndarray.empty and compute.GPUndarray.empty begin ndarray workflows.
- compute.kernels.reduceF32 represents the built-in kernel library.
- compute.readback.readF32 reads GPU results asynchronously.