Skip to content

Document CUB environments for users - #10102

Closed
bernhardmgruber wants to merge 3 commits into
NVIDIA:mainfrom
bernhardmgruber:docs_env_simple
Closed

bernhardmgruber wants to merge 3 commits into
NVIDIA:mainfrom
bernhardmgruber:docs_env_simple

Conversation

@bernhardmgruber

Copy link
Copy Markdown
Contributor

Works towards: #7712

@bernhardmgruber
bernhardmgruber requested a review from a team as a code owner July 22, 2026 17:09
@bernhardmgruber
bernhardmgruber requested a review from griwes July 22, 2026 17:09
@github-project-automation github-project-automation Bot moved this to Todo in CCCL Jul 22, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Jul 22, 2026
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Documentation
    • Added guidance on execution environments for CUB device-wide algorithms.
    • Documented environment construction, composition, implicit environments, and convenience builders such as tuning, requirements, and guarantees.
    • Added the new environments page to the CUB documentation navigation.

Walkthrough

Adds a CUB documentation page describing execution environments, environment composition, implicit environments, and convenience builders. Updates the CUB index to include the new page.

Changes

Execution environments documentation

Layer / File(s) Summary
Document and publish execution environments
docs/cub/environments.rst, docs/cub/index.rst
Defines execution environments, demonstrates prop and env composition, explains implicit environment types, documents tune, require, and guarantee, and adds the page to the CUB documentation toctree.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 23db9f9 and 7e698af.

📒 Files selected for processing (2)
  • docs/cub/environments.rst
  • docs/cub/index.rst

Comment thread docs/cub/environments.rst
Comment on lines +26 to +35
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`.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

sed -n '1,120p' docs/cub/environments.rst

Repository: 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

Comment thread docs/cub/environments.rst
Comment on lines +32 to +34
auto mr = cuda::mr::resource_ref<>{allocator};
auto mr_env = cuda::std::execution::prop{cuda::mr::get_memory_resource, mr}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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 -n

Repository: 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

@gonidelis

Copy link
Copy Markdown
Member

lets make sure this pr doesn't duplicate this existing pr

@copy-pr-bot

copy-pr-bot Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

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.

@cccl-authenticator-app cccl-authenticator-app Bot moved this from In Review to In Progress in CCCL Jul 23, 2026
@bernhardmgruber

Copy link
Copy Markdown
Contributor Author

lets make sure this pr doesn't duplicate this existing pr

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.

@gonidelis

Copy link
Copy Markdown
Member

My pr closes #7712 which is more fundamental.

We can use this PR to close your issue that has more extensive requirements #7276

@bernhardmgruber

Copy link
Copy Markdown
Contributor Author

Superseded by #10043

@github-project-automation github-project-automation Bot moved this from In Progress to Done in CCCL Aug 28, 2026
@bernhardmgruber
bernhardmgruber deleted the docs_env_simple branch August 28, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants