This content has been marked as final. Show 2 replies
If threads within a wavefront diverge on flow control, all branches of the flow control are executed by every thread in the wavefront that a single thread traverses. The threads that are not supposed to execute the branch have their output suppressed, but the computation still occurs.
Thank you, so the if statement costs as much as executing both branches (if the threads diverge) + cost of evaluating the expressions inside the condition of the if, and no other significant additional cost.