This is an archive of the discontinued LLVM Phabricator instance.

[libc] Add check for locally installed GPUs
ClosedPublic

Authored by jhuber6 on Dec 20 2022, 11:14 AM.

Details

Summary

We need to know which, if any, GPUs the user has on their system if we
want to be able to test the libc source code for the GPU. This patch
adds a basic check using the amdgpu-arch utility which is provided by
clang.

Checking for NVIDIA GPUs will be done later as this is a little
problematic right now. CMake provides a method that we use for Clang but
it will soon be deprecated, the replacement requires a newer CMake
version that we will have in the LLVM 17 branch in the future. CUDA also
provides __nvcc_device_query but it's very new so I'm not sure if we
should rely on it. I may introduce a new tool to do it similar to
amdgpu-arch.

Diff Detail

Event Timeline

jhuber6 created this revision.Dec 20 2022, 11:14 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptDec 20 2022, 11:14 AM
jhuber6 requested review of this revision.Dec 20 2022, 11:14 AM
sivachandra accepted this revision.Dec 20 2022, 11:28 AM
This revision is now accepted and ready to land.Dec 20 2022, 11:28 AM
This revision was landed with ongoing or failed builds.Dec 20 2022, 11:37 AM
This revision was automatically updated to reflect the committed changes.