Stop using ctypes to interface with CUDA libraries. (#33678)
Summary:
Fixes https://github.com/pytorch/pytorch/issues/33016, Continuation of https://github.com/pytorch/pytorch/issues/31160
Pull Request resolved: https://github.com/pytorch/pytorch/pull/33678
Differential Revision: D20249187
Pulled By: ezyang
fbshipit-source-id: 172ce4a0fee7fbe01436a421d1af22ef6173b6ed