Use thrust::reduce sequentially