[cuda.compute]: API cleanup before 1.0#8772
Merged
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
9a8e775 to
172b74f
Compare
| size_t& temp_storage_bytes, | ||
| KeyIteratorT d_keys, | ||
| ValueIteratorT d_items, | ||
| ValueIteratorT d_values, |
Contributor
There was a problem hiding this comment.
Change from key/item to key/value improves readability, 👍.
Suggestion: Move this change to separate PR. It is not related to Python changes.
| # perform the reduction, passing the temporary storage as the first argument: | ||
| reducer(temp_storage, d_in, d_out, op, num_items, h_init) | ||
| # perform the reduction: | ||
| reducer(temp_storage=temp_storage, d_in=d_in, d_out=d_out, num_items=num_items, op=op, h_init=h_init) |
Contributor
There was a problem hiding this comment.
Suggestion: Per naming convention outlined above, this should be d_temp_storage, or even d_temp.
Contributor
🥳 CI Workflow Results🟩 Finished in 1h 27m: Pass: 100%/315 | Total: 4d 15h | Max: 1h 04m | Hits: 94%/186907See results here. |
NaderAlAwar
approved these changes
May 1, 2026
Comment on lines
30
to
31
| op=..., # binary operator (built-in or user-defined) | ||
| num_items=..., # number of input elements |
Contributor
There was a problem hiding this comment.
Nit: this works because it is keyword only but it would look better if we consistently put num_items before op
Contributor
There was a problem hiding this comment.
I suppose in examples as well.
oleksandr-pavlyk
approved these changes
May 1, 2026
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.
Description
cuda.computealgorithm parameters are now keyword-only — positional calls raiseTypeErrornum_itemsbeforeopinreduce_intoandmerge_sort)merge_sortparameter rename:d_in_items/d_out_items→d_in_values/d_out_valuesdevice_merge_sort.cuh: matching rename ofd_items/d_input_items/d_output_items→d_values/d_input_values/d_output_valuesChanged files
Algorithm implementations (7)
_reduce.pynum_itemsbeforeop_segmented_reduce.pynum_segmentsbefore offsets;op/h_initafter offsets_scan.py| Nonefromexclusive_scan'sinit_valueannotation_binary_search.pyd_data, num_items, d_values, num_values, d_out_sort/_radix_sort.pynum_itemsbeforeorder_sort/_merge_sort.pyd_in_items/d_out_items→d_in_values/d_out_values;num_itemsbeforeop_sort/_segmented_sort.pyCUB C++ (1)
cub/device/device_merge_sort.cuh: renamed_items→d_valuesthroughoutTests / examples / benchmarks (72)
All call sites updated to keyword-only form with corrected parameter order.
Docs (1)
docs/python/compute/index.rst: added keyword-only convention to API conventions section; updated object-based API code exampleMigration
Checklist