If you have work items executing in a wavefront and there is a conditional such as:
if(x){
...
}
else{
....
}
What do the work-items execute? is it the case whereby all workitems in the wavefront will execute the first branch (i.e. x == true
). If there are no work-items for which x is false, then the rest of the conditional is skipped?
What happens if one work-item takes the alternative path. Am I told that all workitems will execute the alternate path as well (therefore executing both paths?). Why is this the case and how does it not mess up the program execution