thread divergence

pre-loop code

for (int i=0; i <= threadIdx; ++i) { ...some loop code... } ... post-loop code pre-loop, loop code, post-loop fundamental GPU algorithm -reduce, scan, histogram