[Clang] Only emit CUDA version warnings when creating the CUDA toolchain
authorJoseph Huber <jhuber6@vols.utk.edu>
Tue, 18 Jul 2023 15:27:54 +0000 (10:27 -0500)
committerJoseph Huber <jhuber6@vols.utk.edu>
Tue, 18 Jul 2023 18:48:11 +0000 (13:48 -0500)
commitd2ac0069a21b79efdcd32ba4cc44dc7f08a25b8b
tree790ea4b30b7a9d11de1d08129b453f4680a333b5
parentcf931d4fa56e38e0c806f5f628c5bab831a45991
[Clang] Only emit CUDA version warnings when creating the CUDA toolchain

This warning primarily applies to users of the CUDA langues as there may
be new features we rely on. The other two users of the toolchain are
OpenMP via `-fopenmp --offload-arch=sm_70` and a cross-compiled build
via `--target=nvptx64-nvida-cuda -march=sm_70`. Both of these do not
rely directly on things that would change significantly between CUDA
versions, and the way they are built can sometims make this warning
print many times.

This patch changees the behaiour to only check for the version when
building for CUDA offloading specifically, the other two will not have
this check.

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D155606
clang/lib/Driver/Driver.cpp
clang/lib/Driver/ToolChains/Cuda.cpp
clang/test/Driver/cuda-version-check.cu