Migrate THCAtomics to ATen (#65470)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/65470
Test Plan: Imported from OSS
Reviewed By: H-Huang
Differential Revision: D31148184
Pulled By: ngimel
fbshipit-source-id: aaac3dfb5f2c6f88e9bd922b3a56d0a16a861e17