[CUDA][HIP] Add support for `--offload-arch=native` to CUDA and refactor
authorJoseph Huber <jhuber6@vols.utk.edu>
Thu, 5 Jan 2023 04:18:41 +0000 (22:18 -0600)
committerJoseph Huber <jhuber6@vols.utk.edu>
Wed, 11 Jan 2023 16:30:30 +0000 (10:30 -0600)
commit56ebfca4bcc0e7a54989ad7aea5395b27f67e373
tree5a930b0fd8748580ef408a2561415c67c5d46d4a
parentfbd207fd6f6bc76a41cbf90fb6d87c6fa627ddf7
[CUDA][HIP] Add support for `--offload-arch=native` to CUDA and refactor

This patch adds basic support for `--offload-arch=native` to CUDA. This
is done using the `nvptx-arch` tool that was introduced previously. Some
of the logic for handling executing these tools was factored into a
common helper as well. This patch does not add support for OpenMP or the
"new" driver. That will be done later.

Reviewed By: yaxunl

Differential Revision: https://reviews.llvm.org/D141051
15 files changed:
clang/include/clang/Basic/DiagnosticDriverKinds.td
clang/include/clang/Driver/Options.td
clang/include/clang/Driver/ToolChain.h
clang/lib/Driver/Driver.cpp
clang/lib/Driver/ToolChain.cpp
clang/lib/Driver/ToolChains/AMDGPU.cpp
clang/lib/Driver/ToolChains/AMDGPU.h
clang/lib/Driver/ToolChains/AMDGPUOpenMP.cpp
clang/lib/Driver/ToolChains/Cuda.cpp
clang/lib/Driver/ToolChains/Cuda.h
clang/test/Driver/Inputs/nvptx-arch/nvptx_arch_fail [new file with mode: 0755]
clang/test/Driver/Inputs/nvptx-arch/nvptx_arch_sm_70 [new file with mode: 0755]
clang/test/Driver/amdgpu-hip-system-arch.c [new file with mode: 0644]
clang/test/Driver/amdgpu-openmp-system-arch-fail.c
clang/test/Driver/nvptx-cuda-system-arch.c [new file with mode: 0644]