Add DeviceAllocation.__index__.