def auto_device(obj, stream=0, copy=True):
    if _driver.is_device_memory(obj):
        return obj, False
    else:
        sentry_contiguous(obj)
        if isinstance(obj, np.void):
            devobj = from_record_like(obj, stream=stream)
        else:
            devobj = from_array_like(obj, stream=stream)
        if copy:
            devobj.copy_to_device(obj, stream=stream)
        return devobj, True
Create a DeviceRecord or DeviceArray like obj and optionally copy data from
dataset/ETHPy150Open numba/numba/numba/cuda/cudadrv/devicearray.py/auto_device