================
@@ -553,9 +562,23 @@ void NVPTX::FatBinary::ConstructJob(Compilation &C, const 
JobAction &JA,
       continue;
     // We need to pass an Arch of the form "sm_XX" for cubin files and
     // "compute_XX" for ptx.
-    const char *Arch = (II.getType() == types::TY_PP_Asm)
-                           ? OffloadArchToVirtualArchString(gpu_arch)
-                           : gpu_arch_str;
+    std::string Arch = [&]() -> std::string {
+      bool IsAsm = II.getType() == types::TY_PP_Asm;
+      if (gpu_arch != OffloadArch::SM_custom)
+        return (IsAsm) ? OffloadArchToVirtualArchString(gpu_arch)
----------------
jhuber6 wrote:

```suggestion
        return IsAsm ? OffloadArchToVirtualArchString(gpu_arch)
```

https://github.com/llvm/llvm-project/pull/100247
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to