Skip to content

Return tuple instead of list from device and platform collection APIs#2322

Open
vlad-perevezentsev wants to merge 6 commits into
masterfrom
use_return_tuple
Open

Return tuple instead of list from device and platform collection APIs#2322
vlad-perevezentsev wants to merge 6 commits into
masterfrom
use_return_tuple

Conversation

@vlad-perevezentsev
Copy link
Copy Markdown
Collaborator

Initially the goal was to change dpctl.get_devices() to return a tuple instead of a list to align with the Python Array API specification where info.devices is defined as a tuple

While implementing this change it became clear that the same behavior should be applied consistently across other APIs that return collections of devices or platforms.
This PR also updates get_platforms, get_composite_devices, SyclContext.get_devices, SyclPlatform.get_devices, SyclPlatform.get_composite_devices, SyclDevice.create_sub_devices, SyclDevice.component_devices, and SyclDevice.sub_group_sizes to return tuples instead of lists

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?
  • If this PR is a work in progress, are you opening the PR as a draft?

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 8, 2026

@coveralls
Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 75.39%. remained the same — use_return_tuple into master

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.

2 participants