Repository navigation
[UR][OpenCL] Fix device get_info(CL_DEVICE_PARTITION_TYPE) when size returned is 0 - #23627
Open
VerenaBeckham wants to merge 2 commits into
Open
VerenaBeckham wants to merge 2 commits into
VerenaBeckham wants to merge 2 commits into
Conversation
Contributor
Author
|
Tagging @uditagarwal97 @KornevNikita @kswiecicki due to history of this file. |
bratpiorka
reviewed
Oct 26, 2026
| @@ -191,7 +191,7 @@ ur_result_t urDeviceGetInfo(ur_device_handle_t hDevice, | |||
| /* The OpenCL implementation returns a value of 0 if no properties are | |||
Contributor
There was a problem hiding this comment.
Could you also improve the comment? Something like If device partitioning is not supported, OpenCL may return either a size of 0 or an array containing a single 0. UR reports a size of 0 in both cases.
Contributor
Author
There was a problem hiding this comment.
Good point, done.
bratpiorka
approved these changes
Oct 26, 2026
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.
This fixes sycl-ls for the OpenCLOn12 Platform.
This ticket KhronosGroup/OpenCL-Docs#1475 shows that (at least at the current interpretation of the OpenCL spec) if the device does not support partitioning it should be valid to either
Up to now there was an assumption in UR that the first would always be true, which led to an array-out-of-bounds access in the latter case, which is what is returned by, e.g., OpenCLOn12.