export interface SlicingResults { /** partitions of the input and corresponding part of the uniforms buffer */ slices: InputSlice[]; /** total size of the uniform buffer in bytes */ uniformsBufferSize: number; /** size of each slice of the uniform buffer */ uniformsSliceSize: number; } export type InputSlice = DispatchSlice & UniformSlice; interface DispatchSlice { /** number of dispatches to cover this slice (typically 65K, until the last slice) */ dispatch: number; /** offset in elems to the start of the this slice in the source */ offset: number; } interface UniformSlice { /** offset in in bytes to the start of the this slice in uniforms */ uniformOffset: number; } export interface InputSlicingArgs { /** number of source elements */ elems: number; /** elements processed per dispatch (e.g. workgroupSize * elems processed/workgroup) */ elemsPerDispatch: number; /** max workgroups per dispatch (typically 64K) */ maxDispatches: number; /** size in bytes of uniforms for one dispatch */ baseUniformSize: number; /** required alignment of uniform slices (256) */ uniformAlignSize: number; } /** To handle large input sizes, we need to issue multiple dispatches * since each dispatch is limited to 65K workgroups. * * So we partition the input into slices, and size a partioned uniform * buffer that can be indexed with dynamicOffsets. The idea is that * each slice of the uniform buffer will contain the corresponding offset into * the input buffer, and each dispatch selects the appropriate slice of the * uniform buffer via dynamicOffsets. * * @return array of slices */ export declare function inputSlicing(args: InputSlicingArgs): SlicingResults; export {};