Document CUB environments for users#10102
Conversation
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds a CUB documentation page describing execution environments, environment composition, implicit environments, and convenience builders. Updates the CUB index to include the new page. ChangesExecution environments documentation
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: c2e04548-55c2-4bcf-9c5a-38b007a96844
📒 Files selected for processing (2)
docs/cub/environments.rstdocs/cub/index.rst
| If the type of a value is not queryable directly, | ||
| a simple environment can be constructed using `cuda::std::execution::prop` given a value and a query. | ||
| For example: | ||
|
|
||
| .. code-block:: c++ | ||
|
|
||
| auto mr = cuda::mr::resource_ref<>{allocator}; | ||
| auto mr_env = cuda::std::execution::prop{cuda::mr::get_memory_resource, mr} | ||
|
|
||
| Builds an environment `env` that responds to the `cuda::mr::get_memory_resource` query with the value of `mr`. |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
sed -n '1,120p' docs/cub/environments.rstRepository: NVIDIA/cccl
Length of output: 4524
suggestion: Use a non-queryable value here, or remove the prop wrapper and pass cuda::mr::resource_ref<> directly; resource_ref<> is already presented later as an implicit environment.
Source: Path instructions
| auto mr = cuda::mr::resource_ref<>{allocator}; | ||
| auto mr_env = cuda::std::execution::prop{cuda::mr::get_memory_resource, mr} | ||
|
|
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the referenced documentation and nearby definitions.
git ls-files docs/cub/environments.rst
wc -l docs/cub/environments.rst
cat -n docs/cub/environments.rst | sed -n '1,120p'
# Search for the related terms in docs to understand whether the comment's broader concerns are still relevant.
rg -n "resource_ref|get_memory_resource|guarantee|require|tune|prop\\(" docs/cub docs -g '*.rst' -g '*.md'Repository: NVIDIA/cccl
Length of output: 50367
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# If the docs file is large, inspect just the relevant ranges with line numbers.
sed -n '20,90p' docs/cub/environments.rst | cat -nRepository: NVIDIA/cccl
Length of output: 3747
important: Add the missing semicolons in the prop examples
docs/cub/environments.rst:33,44 — both cuda::std::execution::prop examples are missing a trailing semicolon, so the snippets do not compile.
Source: Path instructions
|
lets make sure this pr doesn't duplicate this existing pr |
|
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. |
Somehow I completely missed that, sorry! I reviewed your PR and it LGTM. Let's get yours in first and then we can see if there are any pieces left here that we should add on top. |
Works towards: #7712