We should probably use an intermediate variable for this and only save the result in the global variable,
since we hand out a pointer to the global variable to the user.

Making the default_device thread-local is an additional option, but that is a bit more difficult since this should work with gcc (mingw, `__thread`) and MSVC (declspec?).