util.py: Set default device for some functions