removed redundant thrust copy, using device_ptr instead