Changed the computation of blocks per grid in CUDA C code.