[CUDA graphs] Make CUDAGeneratorImpl capturable (#47989)
Summary:
Part 1 of https://github.com/pytorch/pytorch/pull/46148 refactor: CUDAGeneratorImpl and eager mode kernel diffs. See [Note [CUDA Graph-safe RNG states]](https://github.com/pytorch/pytorch/compare/master...mcarilli:cudagraphs_generator_diffs?expand=1#diff-0b7fb41bc872bb4d1b6480d4fbbb70e6871c16b8c439a97d9d8ecc6c8b893bc2R13) for the strategy, based on https://github.com/pytorch/pytorch/pull/46148#issuecomment-724414794.
By itself, this PR is a "no-op": it's unusable without cooperation from CUDA graph capture and replay bindings. Part 2 will add those bindings and tests.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/47989
Reviewed By: mrshenli
Differential Revision: D25172740
Pulled By: ngimel
fbshipit-source-id: c4568605755c7b2d28d09d0fbb96837b494e6443