In-memory computing with resistive switching devices