Add multiple passes so that it can handle the case that the number of element in intermediate result larger than one thread block