loadMultipleWGSL¶
Overview¶
Loads data (usually from main memory) with multiple values per thread, storing them typically in shared memory. Notably supports larger sizes than the workgroup size.
grainSize controls how many items are loaded per thread.
@author Jonathan Olson <jonathan.olson@colorado.edu>
Type loadMultipleWGSLOptions¶
- loadExpression?: ( ( index: WGSLExpressionU32 ) => WGSLExpressionT ) | null
wrap with parentheses as needed TODO: should we always do this to prevent errors? - loadStatements?: ( ( varName: WGSLVariableName, index: WGSLExpressionU32 ) => WGSLStatements ) | null
( varName: string, index ) => statements setting varName: T, - storeStatements: ( index: WGSLExpressionU32, value: WGSLExpressionT ) => WGSLStatements
- type: ConcreteType<T>
- outOfRangeValue?: WGSLExpressionT | null
if a length is provided, used to map things out-of-range - inputOrder: "blocked" | "striped"
The actual order of the data in memory (needed for range checks, not required if range checks are disabled) - inputAccessOrder?: "blocked" | "striped"
The order of access to the input data (determines the "value" output order also) - factorOutSubexpressions?: boolean
TODO: outputOrder, support blocked or striped (we're always putting it in the original order right now) Whether local variables should be used to factor out subexpressions (potentially more register usage, but less computation). - & RakedSizable & GlobalIndexable & WorkgroupIndexable & LocalIndexable & OptionalLengthExpressionable
Source Code¶
See the source for loadMultipleWGSL.ts in the alpenglow repository.