Skip to content

[CUB] Extract shared numeric and scan reference test helpers - #12260

Merged
bernhardmgruber merged 1 commit into
NVIDIA:mainfrom
oleksandr-pavlyk:extract-shared-cub-test-helpers
Oct 27, 2026
Merged

bernhardmgruber merged 1 commit into
NVIDIA:mainfrom
oleksandr-pavlyk:extract-shared-cub-test-helpers

Conversation

@oleksandr-pavlyk

@oleksandr-pavlyk oleksandr-pavlyk commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Move numeric utilities and CPU scan reference functions into dedicated headers for reuse by segmented-scan tests. Update the existing scan and reduce test headers to include them without changing test behavior.

This is preparatory PR with no behavior changes for subsequent change to segmented-scan tests to use cuda buffers

This PR provides a focused subset of changes from #11374

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Move numeric utilities and CPU scan reference functions into dedicated
headers for reuse by segmented-scan tests. Update the existing scan and
reduce test headers to include them without changing test behavior.

This is preparatory PR with no behavior changes for subsequent
change to segmented-scan tests to use cuda buffers
@oleksandr-pavlyk
oleksandr-pavlyk requested a review from a team as a code owner October 26, 2026 17:12
@github-project-automation github-project-automation Bot moved this to Todo in CCCL Oct 26, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Oct 26, 2026
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: NVIDIA/cccl
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: c6ebc09
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: bec4d6ca-d041-4e95-bde4-2c1f57c2fab2
Commits

Reviewing files that changed from the base of the PR and between c6ebc09 and ed4c4f4.

Files selected for processing: 4
  • cub/test/catch2_test_device_reduce.cuh
  • cub/test/catch2_test_device_scan.cuh
  • cub/test/catch2_test_numeric_helpers.cuh
  • cub/test/catch2_test_scan_reference.cuh

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Tests
    • Updated internal test utilities for numeric operations and scan reference calculations.
    • Test helpers for extended floating-point values, iterator handling, and default-value initialization are now consolidated for reuse.
    • Existing scan and reduction tests continue to use reference calculations; no end-user behavior changes are included in this update.

The change adds dedicated headers for numeric test helpers and scan reference calculations. The reduction and scan test headers include the new headers and remove corresponding local definitions.

Changes: Reusable CUB test helpers

Layer / File(s) Summary
Numeric helpers and reduction test header
cub/test/catch2_test_numeric_helpers.cuh, cub/test/catch2_test_device_reduce.cuh
The new header defines extended-float operations, iterator and operator unwrapping, and default-value initialization. The reduction test header includes it and removes local helper functions, reference calculations, and type declarations.
Scan reference functions
cub/test/catch2_test_scan_reference.cuh, cub/test/catch2_test_device_scan.cuh
The new header defines exclusive and inclusive scan reference calculations. The scan test header includes it and removes its local definitions. By-key reference helpers remain in the scan test header.

Possibly related PRs

  • NVIDIA/cccl#11374: Its segmented-scan tests use shared type and reference-helper patterns related to the reusable helpers added here.

Suggested reviewers: gonidelis

Priority: Low

Change: Refactor

Merge Risk: Minimal · up to ed4c4

The helper extraction has no substantiated behavior or build regression; it is ready for normal merge checks.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR

@github-actions

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 1h 50m: Pass: 100%/137 | Total: 2d 13h | Max: 1h 50m | Hits: 71%/194137

See results here.

@@ -0,0 +1,149 @@
// SPDX-FileCopyrightText: Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Q: Is it correct to keep the old date here? Not sure since the code was only moved and not touched.

@miscco miscco left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am fine with keeping the old date

@bernhardmgruber
bernhardmgruber merged commit 6f03a49 into NVIDIA:main Oct 27, 2026
182 of 192 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in CCCL Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants