Skip to main content

Module compute_dispatch

Module compute_dispatch 

Source
Expand description

Compute shader dispatch helpers.

Provides workgroup sizing utilities, dispatch grid calculation, and basic barrier / dependency tracking for GPU compute passes.

Structs§

BarrierRecord
A recorded pipeline barrier.
BarrierTracker
Tracks barriers inserted during a compute pass.
DataDrivenDispatch
Computes and stores dispatch parameters that depend on the number of data elements only known at dispatch-preparation time (e.g., after a GPU readback or a CPU-side counter).
DispatchGrid
A 3-D dispatch grid (number of workgroups in each dimension).
DispatchRecord
A recorded compute dispatch (for replay / inspection).
DispatchTracker
Tracks dispatches in a compute pass.
WorkgroupSize
A 3-D workgroup size.

Enums§

BarrierKind
Type of pipeline barrier.
DataDispatchStrategy
Strategy used to derive workgroup counts from a data-dependent element count at dispatch preparation time.

Constants§

MAX_WORKGROUP_DIM
Maximum recommended workgroup size per dimension on most GPUs.

Functions§

dispatch_1d
Calculate the dispatch grid needed to cover count elements with threads of size wg_size in the X dimension.
dispatch_2d
Calculate the dispatch grid needed to cover a width × height image with a planar workgroup of size (wg_x, wg_y).
dispatch_3d
Calculate the dispatch grid for a 3-D volume.
recommend_2d_workgroup
Recommend a square workgroup size that keeps total threads ≤ max_threads and is a power of two.