[TargetParser] Parse Intel GPU architecture names, and use the list in clang - #223199
Draft
srividya-sundaram wants to merge 3 commits into
Draft
[TargetParser] Parse Intel GPU architecture names, and use the list in clang#223199srividya-sundaram wants to merge 3 commits into
srividya-sundaram wants to merge 3 commits into
Conversation
Currently offload-arch prints Intel GPU names which are not a legal parameter for --offload-arch, e.g. "Intel(R) Data Center GPU Max 1100". Print an architecture name instead, e.g. "xe-pvc". The driver reports a GPU IP version, the GMDID, for every device. Add a table that maps a GMDID to a name, and look the device up in it. The table goes in llvm/TargetParser, next to the other GPU lists, because other tools need it too. Some of them are LLVM libraries, which cannot include a clang header. Every row of IntelGPUTargetParser.def holds three things: a name that --offload-arch accepts, the GMDID that the device reports, and the IGCA (Intel Graphics Compute Architecture) level, which is the virtual architecture that the compiler targets. A few names, such as xe-dg2, cover a whole product line. No device reports a GMDID for those, so offload-arch never prints them. A device that is not in the table is reported as an error. Making up a name from its GMDID would not help, because the compiler would not know which IGCA level to compile for. The header declares only the functions that offload-arch needs. More will follow when something needs them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Fold the numeric fallback into getIntelGPUArchName(), so that the GMDID is decoded once and every device gets a name.
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
srividya-sundaram
force-pushed
the
igca-78107
branch
from
September 13, 2026 02:50
bee0522 to
ef29171
Compare
…n clang The Intel GPU list could only name the device a driver reports; add parseArch for the other direction, accepting the friendly, compatibility, alias and numeric spellings, plus getIGCAName for the level to compile for. In clang, drop the two hardcoded Intel architecture strings and consult the list instead. A numeric name whose fields do not fit their GMDID names no device. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
srividya-sundaram
force-pushed
the
igca-78107
branch
from
September 13, 2026 19:00
ef29171 to
d0b8acd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#222072 goes from the GMDID that the Level Zero driver reports for an installed GPU to that device's architecture name, which is what
offload-archprints. This adds the reverse direction, from an architecture name the user writes on--offload-arch, such asxe-pvc, to the device in the list it denotes, viaIntelGPU::parseArch; and it points clang'sOffloadArchat the list instead of its two hardcoded strings. Together they close a round trip: whateveroffload-archprints for an installed GPU is now a name--offload-archaccepts back.