Skip to content

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

Merged
ndgrigorian merged 9 commits into
masterfrom
use_return_tuple
Jun 9, 2026
Merged

Return tuple instead of list from device and platform collection APIs#2322
ndgrigorian merged 9 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

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

@coveralls

coveralls commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Coverage Status

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

Comment thread dpctl/_sycl_platform.pyx
ndgrigorian
ndgrigorian previously approved these changes Jun 8, 2026

@ndgrigorian ndgrigorian left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other than that small adjustment lgtm

@ndgrigorian ndgrigorian left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you @vlad-perevezentsev

@ndgrigorian ndgrigorian merged commit 17b5a6d into master Jun 9, 2026
72 of 77 checks passed
@ndgrigorian ndgrigorian deleted the use_return_tuple branch June 9, 2026 15:11
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.

3 participants