shared memory implementation of histogram.

also changed bin formula to use floor function instead of ceil.