Histogram binning assigns input values to discrete intervals, or bins, and counts how many values fall into each bin. On a GPU, each program instance can read a tile of values and determine their bins. section 4.1.3
Bin destinations depend on the input values, so different program instances can update the same counter. A plain tl.store can overwrite another instance’s update and produce an incorrect count. Use tl.atomic_add to coordinate increments to shared bins; tl.store is suitable when each instance owns a unique output region. section 4.1.3
Two tiles, one bin
If values from two different tiles fall into the same bin, both instances must increment that bin’s counter. Atomic addition prevents one increment from silently overwriting the other. section 4.1.3
