Repository navigation
Expose new SYCL device aspects from DPC++ 2026.x - #2416
Open
antonwolfy wants to merge 2 commits into
Open
antonwolfy wants to merge 2 commits into
antonwolfy wants to merge 2 commits into
Conversation
Add DPCTLSyclAspectType values and SyclDevice.has_aspect_* properties for aspects added in DPC++ 2026.x: - ext_oneapi_is_integrated_gpu - ext_oneapi_clock_sub_group, ext_oneapi_clock_work_group and ext_oneapi_clock_device - ext_oneapi_native_assert, which tells whether assert in kernels works; since 2026.0 removed fallback asserts, it is silently ignored on devices without it - ext_oneapi_register_host_memory ext_oneapi_register_host_memory is only defined starting with DPC++ 2026.2, while the minimum compiler is 2026.0, so its mapping is guarded by SYCL_EXT_ONEAPI_REGISTER_HOST_MEMORY, as is done for ext_oneapi_ipc_memory. Built with an older compiler, the query returns False. Add the new aspects, and the missing ext_oneapi_ipc_memory, to the Python aspect tests, and the new aspects to the C-API aspect test.
antonwolfy
requested review from
ndgrigorian and
vlad-perevezentsev
as code owners
November 4, 2026 13:01
|
View rendered docs @ https://intelpython.github.io/dpctl/pulls/2416/index.html |
Collaborator
ndgrigorian
reviewed
Nov 4, 2026
| std::make_pair("ext_oneapi_native_assert", | ||
| sycl::aspect::ext_oneapi_native_assert) | ||
| #ifdef SYCL_EXT_ONEAPI_REGISTER_HOST_MEMORY | ||
| , |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the new device-aspect APIs and Python properties.
No open issues 🎉
What changed in this PR
Exposes six DPC++ 2026.x device aspects through dpctl’s C API and Python SyclDevice properties, enabling capability queries and aspect-based device selection.
Changes:
- Adds integrated-GPU, clock-scope, native-assert, and host-memory-registration aspects across the C and Cython layers.
- Guards host-memory-registration mappings for compatibility with DPC++ versions before 2026.2.
- Extends Python and C API tests and documents the new properties and compiler-dependent behavior.
| File | Description |
|---|---|
libsyclinterface/tests/test_sycl_device_aspects.cpp |
Adds C API coverage for the new aspects, with a compiler guard where required. |
libsyclinterface/include/syclinterface/dpctl_sycl_enum_types.h |
Adds six public aspect enum values. |
libsyclinterface/helper/source/dpctl_utils_helper.cpp |
Adds string and enum mappings for the new aspects. |
dpctl/tests/test_sycl_device.py |
Extends property and selection tests to the new aspects and IPC memory. |
dpctl/tests/_device_attributes_checks.py |
Adds attribute-access checks for all six new properties. |
dpctl/_sycl_device.pyx |
Exposes and documents six new device capability properties. |
dpctl/_backend.pxd |
Declares the matching Cython enum bindings. |
CHANGELOG.md |
Records the new queries and older-compiler fallback behavior. |
Review effort: Balanced
ndgrigorian
reviewed
Nov 4, 2026
| case aspect::ext_oneapi_ipc_memory: | ||
| return DPCTLSyclAspectType::ext_oneapi_ipc_memory; | ||
| #endif | ||
| case aspect::ext_oneapi_is_integrated_gpu: |
Collaborator
There was a problem hiding this comment.
All of these will need some kind of guards, so that AdaptiveCpp builds will work
Can also be done in that PR if preferred
This branch has not been deployed
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.
DPC++ 2026.x has device aspects that dpctl doesn't expose yet. This PR adds a
DPCTLSyclAspectTypevalue and aSyclDevice.has_aspect_*property for each of them:ext_oneapi_is_integrated_gpu(2026.0,sycl_ext_oneapi_device_is_integrated_gpu): lets Python code pick paths specific to client GPUs.ext_oneapi_clock_sub_group,ext_oneapi_clock_work_group,ext_oneapi_clock_device(2026.0,sycl_ext_oneapi_clock).ext_oneapi_native_assert: 2026.0 removed fallback asserts, so on a device without this aspect,assertin a kernel is silently ignored.ext_oneapi_register_host_memory(2026.2,sycl_ext_oneapi_register_host_memory).aspect::ext_oneapi_register_host_memoryexists only from DPC++ 2026.2 on, while the minimum compiler is 2026.0. Its mappings indpctl_utils_helper.cppare guarded by theSYCL_EXT_ONEAPI_REGISTER_HOST_MEMORYfeature-test macro, the same wayext_oneapi_ipc_memoryis guarded. The enum value is always defined, so the C-API and the Cython enum don't change with the compiler. Built with 2026.0 or 2026.1,has_aspect_ext_oneapi_register_host_memoryreturnsFalse.The other new aspects are all in 2026.0, so they need no guard.
The property names keep the
ext_oneapi_prefix, ashas_aspect_ext_oneapi_ipc_memorydoes.Tests:
test_sycl_device.py: the new aspects, andext_oneapi_ipc_memory(which was missing), are added tolist_of_supported_aspects. This covers the property anddpctl.select_device_with_aspects._device_attributes_checks.py: a check per new property.test_sycl_device_aspects.cpp: the new aspects are added to the C-API aspect test.ext_oneapi_register_host_memoryis added under the same guard.Tested with icpx 2026.2 on OpenCL CPU and Level Zero GPU (Arrow Lake). The Python test suite has no failures (4515 tests, 1169 skipped), and the C-API tests pass (2504 passed, 808 skipped, run with
DPCTL_VERBOSITY=warning, whichCheckPropertyHandlingneeds). Values reported on that host:ext_oneapi_is_integrated_gpuext_oneapi_clock_sub_groupext_oneapi_clock_work_groupext_oneapi_clock_deviceext_oneapi_native_assertext_oneapi_register_host_memoryThe build with 2026.0/2026.1, where the guard is off, was not tested locally.