[clang] [clang][tools] Add LevelZero support to offload-arch (PR #160570)
Alex Duran via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 24 13:58:36 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;
----------------
adurang wrote:
If we remove the binary name comparison I think it can be done in one loop.
Otherwise you need to make a first pass to check that, because when you're processing the first element you don't know if it's gonna match with a following element or not.
https://github.com/llvm/llvm-project/pull/160570
More information about the cfe-commits
mailing list