---
id: pr-cccl-cub-6980
repo: NVIDIA/cccl
pr: 6980
title: Initial version of `DeviceSegmentedTopk` for fixed-size segments
author: elstehle
date: '2026-02-02'
url: https://github.com/NVIDIA/cccl/pull/6980
source_category: upstream-code
architectures:
- sm90
tags:
- attention kernel
- hopper
- moe kernel
techniques: []
hardware_features:
- hopper
kernel_types:
- attention
- moe
languages:
- cuda-cpp
captured_at: '2026-05-16'
status: merged
merge_sha: c15d57536eb2958446be95d9dbebfb20839a5c04
inclusion_reason: Search-matched CUDA kernel optimization PR; materialize diff/source before synthesis.
changed_paths:
- cub/benchmarks/bench/segmented_topk/keys.cu
- cub/cub/agent/agent_batched_topk.cuh
- cub/cub/agent/agent_topk.cuh
- cub/cub/block/block_topk.cuh
- cub/cub/detail/segmented_params.cuh
- cub/cub/device/dispatch/dispatch_batched_topk.cuh
- cub/cub/device/dispatch/dispatch_common.cuh
- cub/cub/device/dispatch/dispatch_topk.cuh
- cub/cub/device/dispatch/kernels/kernel_batched_topk.cuh
- cub/cub/device/dispatch/tuning/tuning_batched_topk.cuh
- cub/test/catch2_test_device_segmented_topk_keys.cu
- cub/test/catch2_test_device_segmented_topk_pairs.cu
- cub/test/catch2_test_device_topk_common.cuh
artifact_dir: evidence/pull-bundles/cccl-cub/gh-6980
head_ref_oid: f176ff7662e8a21d67fac3ee523d722901928d93
---
# Initial version of `DeviceSegmentedTopk` for fixed-size segments

- Repository: `NVIDIA/cccl`
- PR: [6980](https://github.com/NVIDIA/cccl/pull/6980)
- 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/segmented_topk/keys.cu`
- `cub/cub/agent/agent_batched_topk.cuh`
- `cub/cub/agent/agent_topk.cuh`
- `cub/cub/block/block_topk.cuh`
- `cub/cub/detail/segmented_params.cuh`
- `cub/cub/device/dispatch/dispatch_batched_topk.cuh`
- `cub/cub/device/dispatch/dispatch_common.cuh`
- `cub/cub/device/dispatch/dispatch_topk.cuh`
- `cub/cub/device/dispatch/kernels/kernel_batched_topk.cuh`
- `cub/cub/device/dispatch/tuning/tuning_batched_topk.cuh`
- `cub/test/catch2_test_device_segmented_topk_keys.cu`
- `cub/test/catch2_test_device_segmented_topk_pairs.cu`
- `cub/test/catch2_test_device_topk_common.cuh`

## Evidence Bundle

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