In this work, we investigate gradient coupling effect on amplitude death in an array of N cou- pled nonidentical oscillators with no-flux boundary conditions and periodic boundary conditions respectively. We find that the effects of gradient coupling on amplitude death in diffusive coupled nonidentical oscillators is quite different between those two boundaries conditions. With no-flux boundary conditions, there is a system size related critical gradient coupling $r_c$ within which the gradient coupling tends to monotonically enlarge the amplitude death domain in the parameter space. With the periodical boundary conditions, there is an optimal gradient coupling constant $r_o$ to realize largest AD domain. The gradient coupling first enlarges then decreases the amplitude death domain of diffusive coupled oscillators. The amplitude death domain of parameter space are analytically predicted for small number of gradient coupled oscillators.