getCorankWGSL¶
Overview¶
Co-rank function, that determines the indices into two arrays that would be at a given rank if they were sorted together (with a binary search).
It will return the index into the first array (A), and the index into the second array (B) would just be k - result.
See ByteEncoder.getCorank for more information.
Somewhat adapted from "Programming Massively Parallel Processors" by Hwu, Kirk and Hajj
@author Jonathan Olson <jonathan.olson@colorado.edu>
Type getCorankWGSLOptions¶
- value: WGSLVariableName
output name (u32) - outputIndex: WGSLExpressionU32
- lengthA: WGSLExpressionU32
- lengthB: WGSLExpressionU32
- compare: ( ( indexA: WGSLExpressionU32, indexB: WGSLExpressionU32 ) => WGSLExpressionI32 ) | null
TODO: can we rewrite this as a custom ORDER type? => {-1, 0, 1} (i32) - greaterThan?: ( ( indexA: WGSLExpressionU32, indexB: WGSLExpressionU32 ) => WGSLExpressionBool ) | null
used (sometimes) instead of compare if provided - lessThanOrEqual?: ( ( indexA: WGSLExpressionU32, indexB: WGSLExpressionU32 ) => WGSLExpressionBool ) | null
Source Code¶
See the source for getCorankWGSL.ts in the alpenglow repository.