You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[DOC]: Add documentation page for "How to use Environments" #7712
Is this for new documentation, or an update to existing docs?
New
Describe the incorrect/future/missing documentation
As an advanced user of CCCL algorithms, I want to know how to leverage the latest and greatest of new CCCL algorithm innovations that are exposed through the std::execution::environment abstraction for passing additional information to a functional call.
All of these are important, but conceptually different entities that can be passed through an environment.
This issue can be closed by adding a new documentation page called "How to use Environments" that provides a succinct explanation of what an environment is, how it works, and a taxonomy of the entities we support passing through an environment. At minimum, this should include 1) memory resources 2) tunings 3) requirements 4) guarantees. For each, it should define the category and provide examples.
I should walk away from reading this page and have an understanding of what environments are and the various places I can use them with CCCL APIs.
Work Items
Landing page: what an environment is + why environments
Taxonomy: memory resources - definition + example
Taxonomy: tunings - definition + end-to-end example composing (tracked by
For tunings, it would be great to have examples on how to correctly pass in policies: in cub specifically, there seem to be two main ways of defining the tuning policies, one with a () call operator (e.g. segmented reduce / transform) and one with a query operator (e.g. scan or select).
For each of the types, having an end-to-end example would help significantly.
Plus, examples that I previously saw, often only show the environment with a single argument, but in the general case, for e.g. tuning, at least stream and the tuning policy is required, so it would be good to have the examples working with at least two arguments for environments.
Finally, there seem to be restrictions on the cu stub functions when using function-scope structs, at least with standard versions of nvcc. It would be good to document those as well.
For tunings, it would be great to have examples on how to correctly pass in policies: in cub specifically, there seem to be two main ways of defining the tuning policies, one with a () call operator (e.g. segmented reduce / transform) and one with a query operator (e.g. scan or select).
Tunings are not publicly exposed yet, but when they are, they will use a uniform API across all CUB algorithms.
@bernhardmgruber is there some easy way we can emit a diagnostic if people pass a tuning into an algorithm invocation that doesn't support tunings?
We could diagnose this, but we don't want to. People should be able to use a single environment and pass it to multiple algorithms in succession. So any algorithm should ignore from the environment what it does not need.
Or do we expect all algorithms will supporting tunings once they are publicly available.
I think each CUB algorithm does have a tuning internally, so yes, they will all eventually have public tuning APIs.
People should be able to use a single environment and pass it to multiple algorithms in succession.
Perhaps, but I think people will care even more about having some form of confirmation of "Did the thing I wanted to happen actually happen?". So we should think about ways we can give that to people.
I intentionally omit any general description of how environments work, how they are created and queried etc. @miscco also asked to document what default values CUB will choose if an environment does not contain a stream, a memory resource, a determinism requirement, etc. This issue here should address this on a dedicated documentation page.
Activity
MatthiasKohl commentedon Feb 23, 2026
For tunings, it would be great to have examples on how to correctly pass in policies: in cub specifically, there seem to be two main ways of defining the tuning policies, one with a
()call operator (e.g. segmented reduce / transform) and one with aqueryoperator (e.g. scan or select).For each of the types, having an end-to-end example would help significantly.
Plus, examples that I previously saw, often only show the environment with a single argument, but in the general case, for e.g. tuning, at least stream and the tuning policy is required, so it would be good to have the examples working with at least two arguments for environments.
Finally, there seem to be restrictions on the cu stub functions when using function-scope structs, at least with standard versions of nvcc. It would be good to document those as well.
bernhardmgruber commentedon Feb 23, 2026
Tunings are not publicly exposed yet, but when they are, they will use a uniform API across all CUB algorithms.
jrhemstad commentedon Feb 27, 2026
@bernhardmgruber is there some easy way we can emit a diagnostic if people pass a tuning into an algorithm invocation that doesn't support tunings?
Or do we expect all algorithms will supporting tunings once they are publicly available.
bernhardmgruber commentedon Feb 27, 2026
We could diagnose this, but we don't want to. People should be able to use a single environment and pass it to multiple algorithms in succession. So any algorithm should ignore from the environment what it does not need.
I think each CUB algorithm does have a tuning internally, so yes, they will all eventually have public tuning APIs.
jrhemstad commentedon Feb 27, 2026
Perhaps, but I think people will care even more about having some form of confirmation of "Did the thing I wanted to happen actually happen?". So we should think about ways we can give that to people.
bernhardmgruber commentedon Feb 27, 2026
Right, which is what #7797 investigates.
bernhardmgruber commentedon Apr 23, 2026
I am adding the documentation for the tuning API here:
I intentionally omit any general description of how environments work, how they are created and queried etc. @miscco also asked to document what default values CUB will choose if an environment does not contain a stream, a memory resource, a determinism requirement, etc. This issue here should address this on a dedicated documentation page.
Document CUB environments
Document CUB environments