Migrate THCState to ATen (#65948)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/65948
This guts `THCState` to simply be an empty struct, as well as:
- moving `THCState_getPeerToPeerAccess` and its cache into `ATen`.
- cleaning up dead code in `THCGeneral.cpp`
- moving `THCudaInit` and `THCMagma_init` into `CUDAHooks::initCUDA`
Test Plan: Imported from OSS
Reviewed By: albanD
Differential Revision: D31386275
Pulled By: ngimel
fbshipit-source-id: 5c1f1bbe8c3d2d9f5b99996e0588fb7f07fa6a77