Create CuBLAS PointerModeGuard (#42639)
Summary:
Adds an RAII guard for `cublasSetPointerMode()`.
Updates `dot_cuda` to use the guard, rather than exception catching.
Addresses this comment: https://github.com/pytorch/pytorch/pull/41377#discussion_r465754082
Pull Request resolved: https://github.com/pytorch/pytorch/pull/42639
Reviewed By: malfet
Differential Revision: D22969985
Pulled By: ezyang
fbshipit-source-id: b05c35d1884bb890f8767d6a4ef8b4724a329471