Skip to content

Why shared histogram sizes are RADIX * 2 in OneSweep? #13

Closed Answered by b0nes164
kannaiah asked this question in Q&A
Discussion options

You must be logged in to vote

We use 2 histograms to avoid atomic conflicts as we count digits in the histogramming. Twice the histograms means half the conflicts, and most contemporary GPUs have ample shared memory, so there is no worry about cutting into occupancy. Why not more than 2 histograms then? Going past 2 necessitates more complicated reduction operations across the histograms, which may slow down the kernel. So we use 2 as a nice sweet spot between conflict avoidance, and low histogram reduction cost.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by b0nes164
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants