coherent control flow
gnzlbg opened this issue · comments
Thank you for writing this. The section on masks / conditionals should be expanded on how to do coherent control flow on masks, that is, how to do control flow that depends on:
- all lanes of a mask being true or false
- any lane of a mask being true or false
I am trying to find how to do this without any luck.
This is useful because, for example, if any lane is true, you might want to eagerly compute both branches, and then merge them using selects, but if all lanes are false you can completely skip the computation of one branch and the select.
Will see if I can find something later today.