2 ms·
This article is also relevant: https://medium.com/@jasonbooth_86226/branching-on-a-gpu-18bfc83694f2 https://medium.com/@jasonbooth_86226/branching-on-a-gpu-18bf
by layer8 2y ago
This article is also relevant: https://medium.com/@jasonbooth_86226/branching-on-a-gpu-18bfc83694f2 https://medium.com/@jasonbooth_86226/branching-on-a-gpu-18bf...
“If you consult the internet about writing a branch of a GPU, you might think they open the gates of hell and let demons in. They will say you should avoid them at all costs, and that you can avoid them by using the ternary operator or step() and other silly math tricks. Most of this advice is outdated at best, or just plain wrong.
Let’s correct that.”