A high-speed 2D optoelectronic in-memory computing device with 6-bit storage and pattern recognition capabilities