Interplanetary acceleration of solar cosmic rays to relativistic energy