Yes, for most systems this is thread local, meaning there is no other thread accessing `default_device` so for most cases this can't be problematic.

However, it is still not good "style" to write temporary values to a global.