Skip to content

Unify common functors and optionally expose them #7455

@bernhardmgruber

Description

@bernhardmgruber

We repeatedly define common functors all over CCCL, like __return_constant (at least 2 occurrences)., equal_to_default_t (4 occurrences), always_true_predicate, equal_to_value, equal_to_t, always_false_t, always_true_t, etc. Sometimes, the definitions are slightly different. We should pick a general enough version of those and put them somewhere central, like <cuda/functional>. They can remain internal, but we may also consider making them public.

The motivation is twofold: cleaner code, but also more opportunity for optmization. cub::DeviceTransform for example can optimize if the predicate is exactly cub::detail::transform::always_true_predicate. Any other predicate type (with the same definition) will not lead to an optimal code path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomers.help wantedRequest for input or help from the community

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions