Use thrust::min & thrust::max with explicit template parameter.