Question of using DeviceGuard regarding the exclusive use of a device

Dear folks

We am trying to make a custom device support in PyTorch.

One question is regarding DeviceGuard.
We found that DeviceGuard is a useful tool to make it sure that
what the current device is currently used. Also it gives an intuitive
way of returning to the original device before DeviceGuard is set.

However, we cannot find any mechanism to ensure that the use
of DeviceGuard guarantees the exclusive use of a device inside
PyTorch like using mutex while the selected device is being used.

So it would be great if you share your opinion of DeviceGuard and
its design regarding exclusiveness.

Cheers