[clang] [clang][tools] Add LevelZero support to offload-arch (PR #160570)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 24 14:02:35 PDT 2025


================
@@ -72,27 +83,20 @@ int main(int argc, char *argv[]) {
     return 0;
   }
 
-  // If this was invoked from the legacy symlinks provide the same behavior.
-  bool AMDGPUOnly = Only == VendorName::amdgpu ||
-                    sys::path::stem(argv[0]).starts_with("amdgpu-arch");
-  bool NVIDIAOnly = Only == VendorName::nvptx ||
-                    sys::path::stem(argv[0]).starts_with("nvptx-arch");
-  bool IntelOnly = Only == VendorName::intel ||
-                   sys::path::stem(argv[0]).starts_with("intelgpu-arch");
-  bool All = !AMDGPUOnly && !NVIDIAOnly && !IntelOnly;
-
-  int NVIDIAResult = 0;
-  if (NVIDIAOnly || All)
-    NVIDIAResult = printNVIDIA();
-
-  int AMDResult = 0;
-  if (AMDGPUOnly || All)
-    AMDResult = printAMD();
-
-  int IntelResult = 0;
-  if (IntelOnly || All)
-    IntelResult = printIntel();
-
-  // We only failed if all cases returned an error.
-  return AMDResult && NVIDIAResult && IntelResult;
+  bool All = true;
----------------
jhuber6 wrote:

Might be able to just do
```c
if (exe.startswith("amdgpu"))
  Only = amdgpu:
else if exe.startswith("nvptx");
  Only = nvptx.
```

https://github.com/llvm/llvm-project/pull/160570


More information about the cfe-commits mailing list