Check all CUDA API calls for errors in caffe2/c10/ (#74918)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/74918
Test Plan: Sandcastle
Reviewed By: ngimel
Differential Revision: D35194795
fbshipit-source-id: 8490e5497c37bab0055925ed520c2fd0c37a554c
(cherry picked from commit 52697ab670e2f53c580cfd4ca82c5468ed3bb06c)