---
id: pr-cccl-cub-5677
repo: NVIDIA/cccl
pr: 5677
title: Adds device-level Top-K Parallel Algorithm to CUB
author: ChristinaZ
date: '2025-09-24'
url: https://github.com/NVIDIA/cccl/pull/5677
source_category: upstream-code
architectures:
- sm100
tags:
- attention kernel
- moe kernel
techniques: []
hardware_features: []
kernel_types:
- attention
- moe
languages:
- cuda-cpp
captured_at: '2026-05-16'
status: merged
merge_sha: 37b100bb53bca443fbc4ab0ef6cd41108e88d2eb
inclusion_reason: Search-matched CUDA kernel optimization PR; materialize diff/source before synthesis.
changed_paths:
- cub/benchmarks/bench/topk/keys.cu
- cub/benchmarks/bench/topk/pairs.cu
- cub/cub/agent/agent_topk.cuh
- cub/cub/cub.cuh
- cub/cub/device/device_topk.cuh
- cub/cub/device/dispatch/dispatch_reduce.cuh
- cub/cub/device/dispatch/dispatch_topk.cuh
- cub/cub/device/dispatch/tuning/tuning_topk.cuh
- cub/examples/device/example_device_topk_keys.cu
- cub/examples/device/example_device_topk_pairs.cu
- cub/test/catch2_test_device_topk_api.cu
- cub/test/catch2_test_device_topk_common.cuh
- cub/test/catch2_test_device_topk_keys.cu
- cub/test/catch2_test_device_topk_pairs.cu
artifact_dir: evidence/pull-bundles/cccl-cub/gh-5677
head_ref_oid: d98a457b1d9de7b8dae592ac6b23142bf50c1ff5
---
# Adds device-level Top-K Parallel Algorithm to CUB

- Repository: `NVIDIA/cccl`
- PR: [5677](https://github.com/NVIDIA/cccl/pull/5677)
- Decision: `Search-matched CUDA kernel optimization PR; materialize diff/source before synthesis.`
- Reason: Search-matched CUDA kernel optimization PR; materialize diff/source before synthesis.

## Changed Paths

- `cub/benchmarks/bench/topk/keys.cu`
- `cub/benchmarks/bench/topk/pairs.cu`
- `cub/cub/agent/agent_topk.cuh`
- `cub/cub/cub.cuh`
- `cub/cub/device/device_topk.cuh`
- `cub/cub/device/dispatch/dispatch_reduce.cuh`
- `cub/cub/device/dispatch/dispatch_topk.cuh`
- `cub/cub/device/dispatch/tuning/tuning_topk.cuh`
- `cub/examples/device/example_device_topk_keys.cu`
- `cub/examples/device/example_device_topk_pairs.cu`
- `cub/test/catch2_test_device_topk_api.cu`
- `cub/test/catch2_test_device_topk_common.cuh`
- `cub/test/catch2_test_device_topk_keys.cu`
- `cub/test/catch2_test_device_topk_pairs.cu`

## Evidence Bundle

`evidence/pull-bundles/cccl-cub/gh-5677`
