Efficient pipelined ReRAM-based processing-in-memory architecture for convolutional neural network inference