1. A method for transferring data in an active memory device that includes memory and a processing element, the method comprising: fetching and decoding an instruction for execution by the processing element; and based on determining that the instruction is a gather instruction, the processing element performing: determining a plurality of source addresses in the memory from which to gather data elements; determining a destination address in the memory; and transferring one or more gathered data elements from the plurality of source addresses to contiguous locations in the memory starting at the destination address.