Skip to content

[SYCL][Driver] Restrict '--offload-arch=native' to Intel GPUs - #23095

Draft
KornevNikita wants to merge 8 commits into
intel:syclfrom
KornevNikita:offload-arch-native-sycl
Draft

[SYCL][Driver] Restrict '--offload-arch=native' to Intel GPUs#23095
KornevNikita wants to merge 8 commits into
intel:syclfrom
KornevNikita:offload-arch-native-sycl

Conversation

@KornevNikita

Copy link
Copy Markdown
Contributor

When --offload-arch=native is passed, the driver invokes the
offload-arch utility and uses its output as the list of ARCH values.
The utility prints the names of all the offloading devices present in the
system, but SYCL is not supported for every vendor: currently only Intel
GPU devices are supported.

Pass --only=intel to offload-arch when the source language is SYCL,
so that only the devices which do support SYCL are reported.

Depends on #23060, whose commits show up in the diff of this PR until it
lands.

🤖 Generated with Claude Code

KornevNikita and others added 8 commits August 28, 2026 14:45
…ames

The output of this utility is expected to be a list of names that are legal
--offload-arch parameters, but for Intel GPUs it printed the name of the
device, e.g. "Intel(R) Data Center GPU Max 1100", which is not one.

Query the GMDID of each device with zeDeviceGetProperties and the device IP
version extension, and translate its architecture and release components into
an architecture name using the table in IntelGPUArch.def, which is meant to be
generated from the data published by the GPU driver.  A device that has no
entry in the table is named after all three components of its GMDID, e.g.
xe_40.11.0, so that a GPU newer than the compiler is still usable.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit a7e6682f197f7603915e5de75bc17683f8be6455)
Record the IGCA level of every device in IntelGPUArch.def, so that the
table lists both names a device answers to, and add the names that cover
more than one release (xe-dg2, xe-mtl, xe-bmg, xe-ptl) with a sentinel
GMDID of zero. Move the table to clang/include/clang/Basic/ so that the
driver and the offload-arch tool can share it.

The driver now accepts, and validates against that table, the three
forms of a name the GPU driver uses: the name of an architecture
('xe-lnl-m'), the IGCA level shared by a group of architectures
('igca_40r'), and the numeric form the offload-arch tool prints for an
architecture this build has no name for ('xe_20.4.5'). Of the numeric
form only the architecture and the release are validated, as every
stepping of an architecture shares one name. Anything else is rejected
with the existing 'unsupported offload gpu architecture' diagnostic.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
# Conflicts:
#	clang/tools/offload-arch/LevelZeroArch.cpp
#	clang/unittests/offload-arch/OffloadArchTest.cpp
When '--offload-arch=native' is passed, the driver invokes the
'offload-arch' utility and uses its output as the list of ARCH values.
The utility prints the names of all the offloading devices present in
the system, but SYCL is not supported for every vendor: currently only
Intel GPU devices are supported.

Pass '--only=intel' to 'offload-arch' when the source language is SYCL,
so that only the devices which do support SYCL are reported.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant