Unify `torch/csrc/cuda/shared/cudnn.cpp` include path (#40525)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/40525
Move `USE_CUDNN` define under `USE_CUDA` guard, add `cuda/shared/cudnn.cpp` to filelist if either USE_ROCM or USE_CUDNN is set.
This is a prep change for PyTorch CUDA src filelist unification change.
Test Plan: CI
Differential Revision: D22214899
fbshipit-source-id: b71b32fc603783b41cdef0e7fab2cc9cbe750a4e