Comment Re:Different level of programming (Score 2) 43
Branches are particularly bad on GPUs. In that SIMD model of computation you usually have multiple hardware blocks (called threads but unrelated to CPU threads) implementing the same instruction on different data in parallel. Since some of the threads will evaluate the branch condition to true and others false, and they are all operating in lockstep, that means the hardware needs to execute both branches every time, with some of the threads just sitting doing nothing while the other threads execute the "if", and visa-versa while the others execute the "else".
At least that was the case when I was doing CUDA 5+ years ago. Don't know if things have changed since then.