[PATCH] D99949: [AMDGPU][OpenMP] Add amdgpu-arch tool to list AMD GPUs installed
Jon Chesterfield via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 7 06:59:05 PDT 2021
JonChesterfield added a comment.
I'm happy with this as-is. @jdoerfert is this close enough to what you expected when we discussed this offline?
Adding it directly to AMDGPU.h was a good suggestion. Makes it easy for other amdgpu language drivers to pick it up.
That it's a binary on disk also means that more DIY build systems, e.g. freestanding C++ stuff, can call it directly, in `-march=$(./amdgpu-arch)` fashion.
================
Comment at: clang/tools/amdgpu-arch/AMDGPUArch.cpp:51
+
+ for (unsigned I = 0; I < GPUs.size(); I++) {
+ printf("%s\n", GPUs[I].c_str());
----------------
This strategy looks good. Briefly considered whether we should print while iterating, but that will misbehave if there is an error after printing the first gpu.
unsigned is strictly the wrong type here, though it doesn't matter in practice. Could go with a range based for loop instead.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99949/new/
https://reviews.llvm.org/D99949
More information about the cfe-commits
mailing list