Correctly gate __CUDA_ARCH__ with defined() (#25729)
Summary:
Undefined preprocessor macros being evaluated cause
errors on some compilers/configs. There is an ungated define in caffe2
which is inconsistent with the rest of the file and should be
fixed anyway because it's causing issues in ovrsource.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/25729
Test Plan: contbuilds
Differential Revision: D17211552
Pulled By: akrieger
fbshipit-source-id: 499b123894b255f37ff68079c4ba3650b1599a5c