all-optical permanent on-chip memory