Make CUDA exceptions unlikely and isolate C10_CUDA_CHECK body (#85256)
This marks CUDA exception checks as unlikely, which might have a positive performance impact.
If further isolates part of `C10_CUDA_CHECK` into a separate function and file so that code can be made more expressive in subsequent diffs without bloating functions using the check or creating readability issues.
Test Plan: Sandcastle
Differential Revision: D39619861
Pull Request resolved: https://github.com/pytorch/pytorch/pull/85256
Approved by: https://github.com/ezyang, https://github.com/ngimel