Reconfigurable and non-volatile vertical magnetic logic gates