There are unrevealed factors that bring about the performance variations of resistive switching devices. In this work, Pt/CeO x /Pt devices prepared by magnetron sputtering showed rectification in their asymmetrical current-voltage (I-V) curves during voltage sweeps. X-ray photoelectron spectroscopy showed that the deposited CeO x film had an inhomogeneous composition, and more oxygen vacancies existed in CeO x near the top electrode. The asymmetrical resistance change of the Pt/CeO x /Pt devices can be explained by the presence of more charged oxygen vacancies in CeO x near the top electrode, along with the Schottky conduction mechanism. This work reveals that the compositional inhomogeneity is inevitable in the magnetron sputtering of oxide targets like CeO2 and can be an important source of device-to-device and cycle-to-cycle variations of memristors.