a new way to compute nb_block and thread_per_block