[HIP] support --offload-arch=native
authorYaxun (Sam) Liu <yaxun.liu@amd.com>
Mon, 12 Dec 2022 20:50:44 +0000 (15:50 -0500)
committerYaxun (Sam) Liu <yaxun.liu@amd.com>
Tue, 13 Dec 2022 15:09:33 +0000 (10:09 -0500)
commite8fd998e6194d8749b83b30813e3cb74e5261770
treea71ace20d20638e09768e403e14caa94e67c9da1
parent5a288fa32e0c91b211e39f3e370255916902f898
[HIP] support --offload-arch=native

This patch detects system GPU and use them
in --offload-arch if 'native' is specified. If system GPU
cannot be detected clang will fall back to the default GPU arch.

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D139045
clang/lib/Driver/Driver.cpp
clang/lib/Driver/ToolChains/AMDGPU.h