cccl icon indicating copy to clipboard operation
cccl copied to clipboard

[FEA]: Design Guarantees API

Open gevtushenko opened this issue 2 months ago • 0 comments

Is this a duplicate?

  • [x] I confirmed there appear to be no duplicate issues for this request and that I agree to the Code of Conduct

Area

CUB

Is your feature request related to a problem? Please describe.

As of https://github.com/NVIDIA/cccl/pull/4877 we have requirements API. This interface allows user to make an algorithm guarantee something:

cuda::execution::require(cuda::execution::determinism::run_to_run);

In the example above, user requres run-to-run determinism and algorithm guarantees it.

On the implementation side, we sometimes need this relationship reversed. We want an algorithm to require something and user to guarantee that. For instance, we have multiple implementations of segmented reduction. Some implementations require max segment size to be less than a certain value. If we had an interface that allows user to guarantee max segment size, we'd be able to dispatch to optimal algorithm implementation.

Describe the solution you'd like

Design gaurantees API:

cuda::execution::guarantee(max seg size < 42);
  • [ ] Add cuda::execution::guarantee
  • [ ] Design max segment size guarantee
  • [ ] Leverage guarantees API to optimize segmented reduce

Describe alternatives you've considered

No response

Additional context

No response

gevtushenko avatar Nov 13 '25 18:11 gevtushenko