Repository navigation
Conversation
23818f2 to
7d4e7d9
Compare
OverviewThis PR refactors Key ChangesCUB Device Selection API (
|
| Layer / File(s) | Summary |
|---|---|
DeviceSelect const-reference environment parameters cub/cub/device/device_select.cuh |
Flagged and If environment-based non-temp-storage overloads change env parameter to const EnvT& env, and EnvT template parameter documentation is added. |
DeviceSelect temp-storage environment dispatch cub/cub/device/device_select.cuh |
Stream-based temp-storage Flagged and If overloads are replaced with environment-based overloads that add EnvT template parameter, accept const EnvT& env, and dispatch via detail::dispatch_with_env_and_tuning to derive policy_selector for select::dispatch. FlaggedIf is similarly updated. |
PSTL backend policy-based wiring libcudacxx/include/cuda/std/__pstl/cuda/copy_if.h, remove_if.h, shift_left.h |
Backends pass execution __policy instead of cudaStream_t to cub::DeviceSelect, use nullptr for temp-storage sizing, and access temporary buffers via __get_raw_ptr<0>(). |
User-provided temporary storage tests cub/test/catch2_test_device_select_flagged.cu, catch2_test_device_select_if.cu |
New tests query required temp-storage, allocate device buffers, and exercise user-provided storage paths across cudaStream_t, cuda::stream, cuda::stream_ref, cuda::std::execution::env, and cuda::execution::gpu variants with CUDA success and correctness checks. |
Suggested reviewers
- gevtushenko
Comment @coderabbitai help to get the list of available commands and usage tips.
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
cub/cub/detail/env_dispatch.cuh (1)
131-131: 💤 Low valuesuggestion: Orphan
//!@endcondwith no matching `//! `@cond. The priordispatch_with_env_and_tuning(line 78) is not Doxygen-hidden, so this one presumably shouldn't be either. Remove this line or add//!@cond`` before line 116 if hiding is intended.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 6fbe98e9-2f6c-4544-b42a-5f00b350b05e
📒 Files selected for processing (8)
cub/cub/detail/env_dispatch.cuhcub/cub/device/device_find.cuhcub/cub/device/device_select.cuhcub/test/catch2_test_device_find_env.cucub/test/catch2_test_device_select_if.culibcudacxx/include/cuda/std/__pstl/cuda/copy_if.hlibcudacxx/include/cuda/std/__pstl/cuda/find_if.hlibcudacxx/include/cuda/std/__pstl/cuda/remove_if.h
This comment has been minimized.
This comment has been minimized.
7d4e7d9 to
39bd5a9
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
cub/test/catch2_test_device_select_if.cu (1)
188-215: ⚡ Quick winsuggestion: avoid asserting that temp-storage size is identical between the no-env query and every env query.
DeviceSelect::Ifis being moved to environment-driven dispatch/tuning, so valid env-specific policies can require differentnum_bytes. Query and allocate per-env (or allocate the max across envs) and assert call success, instead ofexpected_allocation_size == num_bytes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 9c6dc9d7-ba80-470b-9559-dd13c55d8521
📒 Files selected for processing (8)
cub/cub/detail/env_dispatch.cuhcub/cub/device/device_find.cuhcub/cub/device/device_select.cuhcub/test/catch2_test_device_find_env.cucub/test/catch2_test_device_select_if.culibcudacxx/include/cuda/std/__pstl/cuda/copy_if.hlibcudacxx/include/cuda/std/__pstl/cuda/find_if.hlibcudacxx/include/cuda/std/__pstl/cuda/remove_if.h
🚧 Files skipped from review as they are similar to previous changes (6)
- libcudacxx/include/cuda/std/__pstl/cuda/remove_if.h
- libcudacxx/include/cuda/std/__pstl/cuda/find_if.h
- cub/cub/detail/env_dispatch.cuh
- cub/cub/device/device_find.cuh
- cub/test/catch2_test_device_find_env.cu
- cub/cub/device/device_select.cuh
39bd5a9 to
025d5ca
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
cub/test/catch2_test_device_select_flagged.cu (1)
232-292: ⚡ Quick winsuggestion: Add one section that carries a non-default tuning in
env. Every case here varies the stream/env wrapper, but they all still exercise the defaultpolicy_selector. A regression that stops forwarding the selector returned bydispatch_with_env_and_tuningwould still pass this test, even though that forwarding is the new behavior this PR is introducing for user-provided temp storage. Based on PR objectives, this refactor is meant to let caller-provided tunings affect the user-supplied-memory path.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 7cf318e8-f002-4ff7-829f-3b8f0c6a4126
📒 Files selected for processing (6)
cub/cub/device/device_select.cuhcub/test/catch2_test_device_select_flagged.cucub/test/catch2_test_device_select_if.culibcudacxx/include/cuda/std/__pstl/cuda/copy_if.hlibcudacxx/include/cuda/std/__pstl/cuda/remove_if.hlibcudacxx/include/cuda/std/__pstl/cuda/shift_left.h
🚧 Files skipped from review as they are similar to previous changes (3)
- libcudacxx/include/cuda/std/__pstl/cuda/remove_if.h
- cub/test/catch2_test_device_select_if.cu
- libcudacxx/include/cuda/std/__pstl/cuda/copy_if.h
This comment has been minimized.
This comment has been minimized.
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
025d5ca to
a0bb633
Compare
🥳 CI Workflow Results🟩 Finished in 2h 33m: Pass: 100%/343 | Total: 13d 10h | Max: 2h 30m | Hits: 37%/1295876See results here. |
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
DeviceFindIf#9318