warp.tile_stack_push#
- warp.tile_stack_push(
- s: Any,
- value: Any,
- has_value: bool,
Push a value onto a tile stack.
Every thread in the block must reach this call. Pushed values are visible to the whole block afterward.
If more values are offered than the stack has room for, the surplus is dropped and the count saturates at
capacity.- Parameters:
s – The tile stack, from
tile_stack()value – The value to push, of the stack’s element type
has_value – Whether this thread contributes a value
- Returns:
The slot the value was written to, in
[0, capacity - 1], or-1ifhas_valuewasFalseor the stack was full. While the stack has room, each contributing thread receives a distinct free slot, but which slot a given thread receives is unspecified. A thread that passedhas_value=Trueand received-1had its value dropped.
See
tile_stack()for a usage example.