Skip to content

[FEA]: Provide cuda::fns - Find the position of the n-th set #11051

Description

@fbusato

Is this a duplicate?

Area

libcu++

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

@nanan-nvidia discovered that the CUDA intrinsic __fns performance was a bottleneck for RLE optimization.
He proposed an optimized version based on binary search.

Describe the solution you'd like

Generalization of Find the position of the n-th set provided in https://github.com/NVIDIA/cccl/blob/main/cub/cub/device/dispatch/kernels/kernel_rle_encode_lookahead.cuh#L198 that works with all (unsigned) integral types

Potentially considering further optimizations, e.g. Select the bit position in https://graphics.stanford.edu/~seander/bithacks.html
and CPU instructions x86 BMI2 PEXT or Arm SVE2 BEXT

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions