[CUDA][HIP] Fix bound arch for offload action for fat binary
authorYaxun (Sam) Liu <yaxun.liu@amd.com>
Wed, 30 Sep 2020 00:16:32 +0000 (20:16 -0400)
committerYaxun (Sam) Liu <yaxun.liu@amd.com>
Fri, 2 Oct 2020 23:05:51 +0000 (19:05 -0400)
commitcbd420c5ed8568774ace3ad8385b2346288e152c
tree824742f805d1e14430c62e27d9cece85d70768a4
parent3847986fd2c838026b9d883bb61f2e419988c1a5
[CUDA][HIP] Fix bound arch for offload action for fat binary

Currently CUDA/HIP toolchain uses "unknown" as bound arch
for offload action for fat binary. This causes -mcpu or -march
with "unknown" added in HIPToolChain::TranslateArgs or
CUDAToolChain::TranslateArgs.

This causes issue for https://reviews.llvm.org/D88377 since
HIP toolchain needs to check -mcpu in HIPToolChain::TranslateArgs.

The bound arch of offload action for fat binary is not really
used, therefore set it to CudaArch::UNUSED.

Differential Revision: https://reviews.llvm.org/D88524
clang/include/clang/Basic/Cuda.h
clang/lib/Basic/Cuda.cpp
clang/lib/Basic/Targets/NVPTX.cpp
clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp
clang/lib/Driver/Driver.cpp
clang/test/Driver/hip-phases.hip
clang/test/Driver/hip-toolchain-device-only.hip [new file with mode: 0644]