CUDA is now really working on device_rewrite

pointer magic everywhere :(