Return tuple instead of list from device and platform collection APIs#2322
Open
vlad-perevezentsev wants to merge 6 commits into
Open
Return tuple instead of list from device and platform collection APIs#2322vlad-perevezentsev wants to merge 6 commits into
vlad-perevezentsev wants to merge 6 commits into
Conversation
|
View rendered docs @ https://intelpython.github.io/dpctl/pulls/2322/index.html |
Collaborator
ndgrigorian
reviewed
Jun 8, 2026
Comment on lines
+604
to
+605
| Tuple[:class:`.SyclPlatform`]: | ||
| A tuple of SYCL platforms on the system. |
Collaborator
There was a problem hiding this comment.
while we're at it, can we adjust the other docstrings to use the Tuple[:class:] return format? It's a bit more readable
ndgrigorian
approved these changes
Jun 8, 2026
ndgrigorian
left a comment
Collaborator
There was a problem hiding this comment.
other than that small adjustment lgtm
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.
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 whereinfo.devicesis defined as a tupleWhile 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_sizesto return tuples instead of lists