Add missing _API definitions. (#30310)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/30310
- Annotate CUDAGenerator.h with correct TORCH_CUDA_API.
This is actually CUDA related functionality with its implementation living
in the cuda/ folder. For some reason it lives at the top level; it
should be moved (but that should be handled in another PR.)
- Add missing TORCH/CAFFE_API annotations to. All of
these functions are used from CUDA code, which means that
we need to correctly annotate them if we split CPU/CUDA code
into separate libraries.
Test Plan: Imported from OSS
Differential Revision: D18762357
Pulled By: ezyang
fbshipit-source-id: c975a8e4f082fe9f4196c2cca40977623caf4148