Skip to content

[EPIC] Make the new CUB tuning API public #7465

Closed
28 of 28 issues completed
Closed

Description

@bernhardmgruber

Depends on:

We should first start with a solid design and write it down, and also ensure the documentation is focused on the user providing tunings, instead of our (internal) tuning process:

For each CUB algorithm, if the tuning API has been implemented internally, we are ready to make it publicly accessible:

  • Add a test (or verify there already is one) for each CUB algorithm overload specifying a custom tuning.
  • Enable public access to tuning properties for CUB environment API overloads.
  • Add or update documentation and examples on how the public tuning API works
  • Deprecated all public CUB dispatchers and agent policies

Table of all tuning policies and their names: https://docs.google.com/spreadsheets/d/1EUdwvmv2n7-WRp30-lt7CQxyu8r6atdfJJx3O6Pf1Ag

Current prompt:

Look at commit fc452a9cb3 which makes the tuning policy for DeviceAdjacentDifference public.
Look at commit 5a9ea633bf which makes the tuning policy for DeviceMergeSort public.
Look at commit 2795a7fdc3 which also deprecates the corresponding agent policies.
Look at commit 979ec0b51c which makes the tuning policy for DeviceFind public.
Look at commit 4be2ca2ac3 which makes the tuning policy for DeviceTransform public.
Please repeat the same logic for DeviceXXX.

The `algorithm_policy` in the `tuning_algorithm.cuh` (the policy struct), and all transitively used types by data members, should be moved to the public namespace and renamed to CamelCase.
The policy structs should remain in the `tuning_*.cuh` header.
Propagate this rename through all places, including:
* Benchmarks (in cub/benchmark/bench)
* Agents, if they exist (in cub/cub/agent/**)
* Any kernels, usually found in a file `kernel_algorithm.cuh` or sometimes in `dispatch_algorithm.cuh`
* Any unit tests

Any `delay_constructor` data member of a tuning policy should be renamed to `lookback_delay`.
Ensure that the operator== and operator!= of all policy structs have [[nodiscard]] and noexcept.

Add a new test for the policy struct that checks for:
semiregular, is_aggregate, aggregate init, designated initializer, and constexpr comparison with == and !=.

Also, extend the documentation at the Device* struct level.
Add an API example, that is provided by a new unit test (*_env_api.cu) file,
showing how a custom policy selector can be passed to the API.

Then, deprecate the cub::Dispatch* struct of that algorithm, if there is one,
and add a `#define CCCL_IGNORE_DEPRECATED_API` into the `catch2_test_*_custom_policy_hub.cu` test.

Also deprecate the public Agent*Policy struct, if there is one, by moving it to a detail namespace and renaming it to snake_case.
Put a deprecated alias with the old name in the public cub namespace.
Rename all uses of the struct to snake_case, except the one in the `catch2_test_*_custom_policy_hub.cu` test.

Finally, generate a summary table as markdown listing all new public API entities.
The columns should be Entity and enumerators/data members.
Format the second column so there is a line break after each entity.
The markdown should be raw and copyable, so I can paste it into a GitHub comment.
Add this heading on top of the table `### New public entities`.

Finally, in CCCL 4.0, we can remove all public dispatchers, which is tracked by #7466.

Intentionally postponed:

Sub-issues

Sub-issues

28 of 28 Issues completed
Loading 28 sub-issues

Activity

  1. changed the title [-]Make the new CUB tuning API public[/-] [+][EPIC] Make the new CUB tuning API public[/+] on Feb 13, 2026
  2. 10 remaining items

  3. modified the milestone: CCCL 3.5 on May 19, 2026
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

Type

Projects

  • Status
    Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions