Skip to content

Conversation

Aminsed
Copy link

@Aminsed Aminsed commented Oct 13, 2025

Add documentation explaining temp_storage_bytes query pattern.

  • Clarify two-phase usage pattern
  • Document what arguments are required vs optional
  • Explain that pointers can be nullptr during query
  • Add example showing proper usage

Fixes #847

@Aminsed Aminsed requested a review from a team as a code owner October 13, 2025 15:18
@github-project-automation github-project-automation bot moved this to Todo in CCCL Oct 13, 2025
@Aminsed Aminsed requested a review from gonidelis October 13, 2025 15:18
Copy link
Contributor

copy-pr-bot bot commented Oct 13, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@cccl-authenticator-app cccl-authenticator-app bot moved this from Todo to In Review in CCCL Oct 13, 2025
../api/device


Determining Temporary Storage Requirements
Copy link
Contributor

Choose a reason for hiding this comment

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

would be nice to also mention the single-phase API

@Aminsed Aminsed force-pushed the doc/temp_storage_bytes_guide branch from 1dc3643 to 11abc08 Compare October 13, 2025 20:09
@Aminsed Aminsed requested a review from fbusato October 13, 2025 20:10
Copy link
Member

@gonidelis gonidelis left a comment

Choose a reason for hiding this comment

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

single phase APIs open up a whole new space of explanation for the documentation - the two phase clarifications though are much needed. Thanks a lot for taking the time to provide docs for it.


Example pattern:

.. code-block:: c++
Copy link
Member

Choose a reason for hiding this comment

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

we stopped using code-block and rather use literalincludes now linked to standalone .cu source examples.

**Single-Phase API** (Environment-Based)

Some algorithms provide environment-based overloads that eliminate the two-phase call pattern.
These APIs accept an execution environment parameter. See the individual algorithm documentation for availability.
Copy link
Member

Choose a reason for hiding this comment

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

Some algorithms: we are in the process of adding these APIs for all algorithms. Let's not make it sound like we selectively picked some algorithms to support this feature.

eliminate the two-phase call pattern: they eliminate the explicit allocation requirements which relives us from a) two phase call b) the two legacy storage arguments in the beginning of the parameter list of every device premitive.

These APIs accept an execution environment parameter.: I feel like there is much more to be said here. There is a blogpost coming out soon that can be used as inspo. Trying to sum it up briefly:

  1. the execution environment arg is at the end and is defaulted which means users do not have to pass something explicitly to it.

  2. the execution environment arg can be used to select on which memory pool the primitive will be executed:

    i) there are existing memory resources provided by CCCL or

    ii) the user can create their own custom memory resource

  3. in some algorithms the argument can be used to specify the deterministic requirements (expand on det reqs) of the algorithm

  4. the user can still pass the stream as before in the templated execution environment arg

  5. all of the above can be passed simultaneously in a centralized control argument manner (show how).

There are more to be said but are not feature complete so we can avoid them for now.

@github-project-automation github-project-automation bot moved this from In Review to In Progress in CCCL Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Documentation (& code) regarding determining temp_storage_bytes not very clear

3 participants