Use signed offset type for DevicePartition#8971
Conversation
The env-overloads in cub::DevicePartition used unsigned offset types, while the non-env-overloads used signed ones. This was presumably an oversight in NVIDIA#7459. Fixes: NVIDIA#8968
📝 WalkthroughSummary by CodeRabbit
Walkthrough
ChangesOffset type alignment
Assessment against linked issues
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
cub/cub/device/device_partition.cuh (1)
324-331: ⚡ Quick winsuggestion: Add regression tests for env overload offset-bound behavior.
The signed offset switch andis_exceeding_offset_typeguard look aligned with the non-env path; add targeted tests that cover boundary (max signed offset) and overflow (max + 1for unsignedNumItemsT) inputs for both envFlaggedand envIfoverloads to prevent regressions.As per coding guidelines, "cub/**/*: Focus on algorithm correctness, temporary-storage protocol, dispatch/policy selection, stream behavior, CUDA error handling, synchronization, memory access safety, performance regressions, and test coverage."
Also applies to: 575-582
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 2d52e5ac-8795-4344-b77f-a99a02b6f277
📒 Files selected for processing (1)
cub/cub/device/device_partition.cuh
🥳 CI Workflow Results🟩 Finished in 3h 28m: Pass: 100%/283 | Total: 6d 16h | Max: 1h 53m | Hits: 53%/430269See results here. |
|
Successfully created backport PR for |
The env-overloads in cub::DevicePartition used unsigned offset types, while the non-env-overloads used signed ones. This was presumably an oversight in #7459.
Fixes: #8968