Seems this is exactly the same as in CUDA. Should this live in `device` then?