We consider an adaptive smoothing spline with a piecewise-constant penalty function lambda(x), in which a univariate smoothing parameter A in the classic smoothing spline is converted into an adaptive multivariate parameter lambda. Choosing the optimal value of lambda is critical for obtaining desirable estimates. We propose to choose lambda by minimizing a multivariate version of the generalized cross -validation function; the resulting estimator is shown to be consistent and asymptotically optimal under some general conditions-i.e., the counterparts of the nice asymptotic properties of the generalized cross validation in the ordinary smoothing spline are still provable. This provides theoretical justification of adopting the multivariate version of the generalized cross validation principle in adaptive smoothing splines.