Skip to content

Replace detail::merge::dispatch by CUB's public API - #8381

Merged
bernhardmgruber merged 5 commits into
NVIDIA:mainfrom
bernhardmgruber:use_tuning_merge
Apr 16, 2026
Merged

bernhardmgruber merged 5 commits into
NVIDIA:mainfrom
bernhardmgruber:use_tuning_merge

Conversation

@bernhardmgruber

@bernhardmgruber bernhardmgruber commented Apr 10, 2026 •

Copy link
Copy Markdown
Contributor
  • Use the new tuning API internally where possible
  • Drop 32 bit offset types in benchmarks (public API just uses int64)
  • Drop index type dispatch in Thrust (public API just uses int64)

This PR does change the SASS of cub.bench.merge.pairs.base (tested on SM120), but this is expected since we discard all 32-bit offset type benchmarks. Those are not needed, since the public API does not allow to compile a 32-bit kernel.

This PR will also take away Thrust's ability to compile a 32-bit offset type kernel, which is not needed since the 64-bit offset type version is on par: #3530

Fixes: #7955

@github-project-automation github-project-automation Bot moved this to Todo in CCCL Apr 10, 2026
@bernhardmgruber
bernhardmgruber requested review from a team as code owners April 10, 2026 21:45
@bernhardmgruber bernhardmgruber changed the title Replace detail::merge::dispatch by CUB's public API Replace detail::merge::dispatch by CUB's public API Apr 10, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Apr 10, 2026
Comment on lines +78 to +79
template <typename DefaultPolicySelector, typename EnvT, typename AlgorithmCallable>
CUB_RUNTIME_FUNCTION static cudaError_t dispatch_with_env_and_tuning(EnvT env, AlgorithmCallable&& algorithm_callable)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a good name for this function yet, but I think it will at some point replace dispatch_with_env entirely. But this rollout will take time.

Comment on lines -50 to -61
struct block_size_retreiver_t
{
int* ptr;

template <class ActivePolicyT>
cudaError_t Invoke()
{
*ptr = ActivePolicyT::SingleTilePolicy::BLOCK_THREADS;
return cudaSuccess;
}
};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drive-by fix. This was unused.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Comment thread cub/benchmarks/bench/merge/keys.cu Resolved
Comment thread cub/benchmarks/bench/merge/pairs.cu Resolved
@github-actions

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 3h 06m: Pass: 100%/329 | Total: 2d 18h | Max: 46m 11s | Hits: 99%/298268

See results here.

@bernhardmgruber
bernhardmgruber merged commit 06ba38f into NVIDIA:main Apr 16, 2026
346 of 349 checks passed
@bernhardmgruber
bernhardmgruber deleted the use_tuning_merge branch April 16, 2026 09:10
jainishmehta pushed a commit to jainishmehta/cccl that referenced this pull request Apr 19, 2026
This includes using the new tuning API internally where possible.

Fixes: NVIDIA#7955
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Use the new tuning API internally for detail::merge::dispatch_t

3 participants