Work on device_ptr, not yet finished