  The global estimation problem of the drift function is considered for a large
class of ergodic diffusion processes. The unknown drift $S(\cdot)$ is supposed
to belong to a nonparametric class of smooth functions of order $k\geq1$, but
the value of $k$ is not known to the statistician. A fully data-driven
procedure of estimating the drift function is proposed, using the estimated
risk minimization method. The sharp adaptivity of this procedure is proven up
to an optimal constant, when the quality of the estimation is measured by the
integrated squared error weighted by the square of the invariant density.
