The source a uniform random u in [0, 1) picks: the first whose prefix sum exceeds u × total (what the GPU does).
u
u × total
The source a uniform random
uin [0, 1) picks: the first whose prefix sum exceedsu × total(what the GPU does).