add open device registration test with cpp extensions (#80477)
Adding a test for open device registration using cpp extensions.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/80477
Approved by: https://github.com/albanD, https://github.com/malfet