warp.tile_scan_inclusive#
- warp.tile_scan_inclusive( ) Tile[Scalar, tuple[int, ...]]#
Kernel
Inclusive scan (prefix sum) across the tile.
This function cooperatively performs an inclusive scan (cumulative sum) across the tile.
- param a:
The input tile. Must be a tile of type float32, int32, or uint32.
- returns:
A new tile containing the inclusive scan result.
Example:
@wp.kernel def scan_example(): t = wp.tile_arange(1, 5, dtype=int) s = wp.tile_scan_inclusive(t) print(s) wp.launch_tiled(scan_example, dim=[1], inputs=[], block_dim=16)
Prints:
[1, 3, 6, 10] = tile(shape=(4), storage=register)