[libc] Support setting 'native' GPU architecture for libc
authorJoseph Huber <jhuber6@vols.utk.edu>
Mon, 27 Mar 2023 18:20:24 +0000 (13:20 -0500)
committerJoseph Huber <jhuber6@vols.utk.edu>
Tue, 28 Mar 2023 18:50:39 +0000 (13:50 -0500)
commitc57a58cd0cfed0cb67e71c8ba30f53f397127a98
tree4698a82e3fe12362b273003fba81d77133e93754
parent164b918d73779f776ab3ac6a633d0832ca9e6622
[libc] Support setting 'native' GPU architecture for libc

We already use the `amdgpu-arch` and `nvptx-arch` tools to determine the
GPU architectures the user's system supports. We can provide
`LIBC_GPU_ARCHITECTURES=native` to allow users to easily build support
for only the one found on their system. This also cleans up the code
somewhat.

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D146994
libc/cmake/modules/prepare_libc_gpu_build.cmake