[PATCH] D139045: [HIP] support --offload-arch=native

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 12 18:25:55 PST 2022


yaxunl marked 2 inline comments as done.
yaxunl added inline comments.


================
Comment at: clang/lib/Driver/Driver.cpp:3058
       // Collect all offload arch parameters, removing duplicates.
+      const StringRef NativeArchStr = "native";
       std::set<StringRef> GpuArchs;
----------------
tra wrote:
> Nit: It's used only once. May as well compare with "native" directly.
will do


================
Comment at: clang/lib/Driver/Driver.cpp:3076
+            SmallVector<std::string, 1> GPUs;
+            auto Err = TC->detectSystemGPUs(Args, GPUs);
+            if (!Err) {
----------------
tra wrote:
> Does it guarantee that a returned list of architectures contains only canonical names?
Yes. amdgpu-arch calls ROCm runtime to get GPU arch, which uses canonical gfx names https://github.com/RadeonOpenCompute/ROCR-Runtime/blob/adae6c61e10d371f7cbc3d0e94ae2c070cab18a4/src/core/runtime/isa.cpp#L245


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139045/new/

https://reviews.llvm.org/D139045



More information about the cfe-commits mailing list