Skip to content

[DOC] Improve CUB environment documentation #7276

Description

@bernhardmgruber

The CUB device-wide algorithm documentation explains how to use the environment overloads by some examples: https://nvidia.github.io/cccl/cub/api_docs/device_wide.html#. However, this is too little information to properly understand and work with environments.

We should expand the documentation with:

  • how to make user-defined types act like environments. We do this for example for stream_ref which is an environment that answers to the get_stream CPO, but how do other libraries achieve that?
  • how to build and environment with and without the supporting functions like require, tune, etc. [partially handled Add environment docs landing page with essential info #10043]
  • when to use prop
  • expected nesting of environments by CUB (e.g. the tuning environment is nested within the outer environment containing e.g. the memory resource)
  • Document nvcc restrictions on function-scope policy-selector structs per this comment

We should also document what operations are supported on environments. This may go to the developer documentation:

  • what functions can I call? Like query_or or call_or, etc.
  • how do I extract a stream, memory resource, tuning, determinism, etc?
  • what are the default values we should use of an environment query fails? [partially handled by https://github.com/Add environment docs landing page with essential info #10043]
  • are environments copyable, movable, ..? How do we pass them around?
  • what's a CPO?

Activity

  1. bernhardmgruber commented on Jan 16, 2026

    @bernhardmgruber
    ContributorAuthor

    @gevtushenko I am assigning this to you since you had a major influence on the CUB environment API design. I would be happy if you could put together some information on the questions above, or add some links to documents with further information, etc. I can also write up some of the documentation (I will probably write the tuning part). We may also want to have input from @ericniebler, @miscco and @pciolkosz.

  2. added a commit that references this issue on Jul 21, 2026
    ec3374b
  3. moved this from Todo to In Progress in CCCLon Jul 21, 2026
  4. moved this from In Progress to In Review in CCCLon Jul 21, 2026
  5. moved this from In Review to In Progress in CCCLon Jul 21, 2026
  6. gonidelis commented on Jul 21, 2026

    @gonidelis
    Member

    @bernhardmgruber I converted this issue into a checklist so that we have actionable items. I also cross referenced with #7712 asks/checklist so that no duplicates exist in the two working lists.

    Consider Jake's issue as the entry level documentation and this (yours) issue as an enhancement on the existing entry docs

  7. added a commit that references this issue on Jul 22, 2026
    c5d573e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Projects

  • Status
    In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions