Repository navigation
[CUB] Refactor cub::DeviceSelect::If to always take an environment - #9456
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
a0bb633 to
ff89356
Compare
5042f64 to
fcd3004
Compare
fcd3004 to
ae24f0a
Compare
ae24f0a to
bcd1fd6
Compare
bcd1fd6 to
a8906a9
Compare
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (4)
OverviewThis pull request refactors Changes by FileCore API Changes:
|
| Layer / File(s) | Summary |
|---|---|
API and docs updates cub/cub/device/device_select.cuh |
Environment-based overloads change to const EnvT&, and device-storage overloads add EnvT template parameters and matching documentation. |
Out-of-place device-storage dispatch cub/cub/device/device_select.cuh |
The out-of-place device-storage overload removes direct stream dispatch and routes through dispatch_with_env_and_tuning before calling detail::select::dispatch from the lambda. |
In-place device-storage dispatch cub/cub/device/device_select.cuh |
The potentially in-place device-storage overload removes the stream parameter, adds EnvT plus const EnvT& env, and dispatches through dispatch_with_env_and_tuning to the in-place detail::select::dispatch variant. |
PSTL call site updates libcudacxx/include/cuda/std/__pstl/cuda/copy_if.h, libcudacxx/include/cuda/std/__pstl/cuda/remove_if.h |
Sizing calls pass nullptr and __policy; kernel launches use __get_raw_ptr<0>() and pass __policy instead of __stream.get(). |
User-provided storage tests cub/test/catch2_test_device_select_if.cu |
The test file adds execution-environment includes and two guarded cases covering out-of-place and in-place user-provided storage across multiple environment variants with partition checks. |
Suggested reviewers
- bernhardmgruber
- elstehle
Comment @coderabbitai help to get the list of available commands.
|
/ok to test |
@miscco, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/1/ |
|
/ok to test |
@miscco, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/1/ |
a8906a9 to
b5e4e2c
Compare
|
/ok to test |
@miscco, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/1/ |
b5e4e2c to
f7de38f
Compare
This comment has been minimized.
This comment has been minimized.
f7de38f to
68d34fa
Compare
This comment has been minimized.
This comment has been minimized.
68d34fa to
55d861f
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
cub/test/catch2_test_device_select_if.cu (1)
183-187: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winsuggestion: declare immutable locals as
const(le, pointer aliases, temp-storage pointer aliases) to match CCCL const-correctness rules in C++/CUDA files.As per coding guidelines, “All variables that are not modified must be declared const...”
Also applies to: 202-203, 277-281, 290-291
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 1a214b9a-3480-465a-8e7f-c9ecc5e1bd4d
📒 Files selected for processing (4)
cub/cub/device/device_select.cuhcub/test/catch2_test_device_select_if.culibcudacxx/include/cuda/std/__pstl/cuda/copy_if.hlibcudacxx/include/cuda/std/__pstl/cuda/remove_if.h
🚧 Files skipped from review as they are similar to previous changes (3)
- libcudacxx/include/cuda/std/__pstl/cuda/remove_if.h
- libcudacxx/include/cuda/std/__pstl/cuda/copy_if.h
- cub/cub/device/device_select.cuh
| const auto boundary = in.begin() + num_selected_out[0]; | ||
| REQUIRE(thrust::all_of(c2h::device_policy, in.begin(), boundary, le)); | ||
| }; |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
important: the in-place test assertion is too weak and can miss wrong num_selected_out/boundary results. Add a reference count (or host-side expected partition boundary) and assert num_selected_out[0] matches it before validating the prefix.
As per path instructions, “Focus on algorithm correctness ... and test coverage.”
Source: Path instructions
We want to be able to pass tunings to the APIs that take user provided memory Make sure we can pass any environment or stream type to them
55d861f to
1749bea
Compare
This comment has been minimized.
This comment has been minimized.
🥳 CI Workflow Results🟩 Finished in 3h 21m: Pass: 100%/345 | Total: 6d 02h | Max: 1h 25m | Hits: 99%/497513See results here. |
Description
closes
Checklist