Added support for discard_data in AMP device_vector + various fixes