I believe line 80 should read:
if(num_elements % block_size) ++grid_size;
instead of the current:
if(grid_size % block_size) ++grid_size;
In other words, add an extra block to the grid if the total number of
elements isn't evenly divided by the block size.
Original issue reported on code.google.com by mark.jar...@gmail.com on 7 May 2010 at 7:26