Skip to content

Segmented scan non api tests use cuda buffer - #12495

Open
oleksandr-pavlyk wants to merge 1 commit into
NVIDIA:mainfrom
oleksandr-pavlyk:segmented-scan-non-api-tests-use-cuda-buffer
Open

oleksandr-pavlyk wants to merge 1 commit into
NVIDIA:mainfrom
oleksandr-pavlyk:segmented-scan-non-api-tests-use-cuda-buffer

Conversation

@oleksandr-pavlyk

@oleksandr-pavlyk oleksandr-pavlyk commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR is a split from #11374 and changes non-API tests for DeviceSegmentedScan algorithm to use C2H buffer utilities and CCCL Runtime API.

Closes #12580

Checklist

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

@copy-pr-bot

This comment was marked as outdated.

@github-project-automation github-project-automation Bot moved this to Todo in CCCL Nov 5, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Progress in CCCL Nov 5, 2026
@oleksandr-pavlyk

This comment was marked as outdated.

@github-actions

This comment has been minimized.

@oleksandr-pavlyk
oleksandr-pavlyk force-pushed the segmented-scan-non-api-tests-use-cuda-buffer branch from b39b49e to c6ce670 Compare November 10, 2026 14:54
@oleksandr-pavlyk
oleksandr-pavlyk marked this pull request as ready for review November 10, 2026 14:54
@oleksandr-pavlyk
oleksandr-pavlyk requested a review from a team as a code owner November 10, 2026 14:54
@cccl-authenticator-app cccl-authenticator-app Bot moved this from In Progress to In Review in CCCL Nov 10, 2026
@coderabbitai

coderabbitai Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests
    • Updated segmented-scan tests to use explicit CUDA streams and buffer-based input and output checks across standard, multi-segment, noncommutative, and environment-based cases.
    • Added coverage for queued input preparation and exclusive-sum results, and retained checks for in-place scans, tuning configurations, custom streams, and default-stream behavior.
    • Added a reusable utility for generating test inputs in host buffers.

The segmented-scan tests replace Thrust-backed containers with CUDA buffers and raw pointers. They pass explicit streams to scan calls, use stream-aware copies and comparisons, and add a host-buffer generator for test inputs.

Changes: Segmented scan test migration

Layer / File(s) Summary
Segmented-scan API test coverage
cub/test/catch2_test_device_segmented_scan.cu
The API tests use host and device buffers, pass streams to scan operations, and verify output through host pointers. They retain coverage for scan variants, offset APIs, and matching-type in-place scans.
Environment and tuning tests
cub/test/catch2_test_device_segmented_scan_env.cu
Environment and tuning tests use C2H buffers and device pointers. The tests include stream-ordering coverage and read tuning selections through the stream.
Two-phase scans across stream modes
cub/test/catch2_test_device_segmented_scan_env.cu
Two-phase tests use device pointers and stream-aware comparisons for custom streams, legacy null-stream cases, and tuning cases.
Multi-segment dispatch and scan cases
cub/test/catch2_test_device_segmented_scan_multi_segment.cu
Dispatch helpers accept streams and device buffers. Noncommutative and integer scan cases use host/device buffers and stream-aware output checks.
Empty-segment and iterator cases
cub/test/catch2_test_device_segmented_scan_multi_segment.cu
Empty and reversed segment cases retain canary checks with buffer-based setup. Iterator dispatch tests also use stream-aware buffers and comparisons.
Host-buffer generation and noncommutative scan
cub/test/catch2_test_device_segmented_scan_utils.cuh, cub/test/catch2_test_device_segmented_scan_noncommutative.cu
A host-buffer tabulation helper is added and used by the noncommutative scan test, which runs and checks results with an explicit stream.

Possibly related issues

Possibly related PRs

  • NVIDIA/cccl#9787 — Both PRs change segmented-scan tuning tests.
  • NVIDIA/cccl#10898 — This PR continues the segmented-scan test migration to buffers established in that PR.
  • NVIDIA/cccl#11374 — Both PRs migrate segmented-scan tests to CUDA buffers and explicit streams.

Suggested reviewers: jacobfaib

Change: Other

Merge Risk: Minimal · up to c6ce6

This PR migrates the segmented-scan tests from Thrust containers to CUDA buffers with explicit streams. No concrete defect was found in the stream ordering or buffer handling, so it looks ready to merge after normal CI.

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

Run configuration

  • Source mode: Auto
  • Repository: NVIDIA/cccl
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: 0dd2af4
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 094e0955-c7cd-44d8-97a8-dc126a6b2a25
Commits

Reviewing files that changed from the base of the PR and between 0dd2af4 and c6ce670.

Files selected for processing: 5

  • cub/test/catch2_test_device_segmented_scan.cu
  • cub/test/catch2_test_device_segmented_scan_env.cu
  • cub/test/catch2_test_device_segmented_scan_multi_segment.cu
  • cub/test/catch2_test_device_segmented_scan_noncommutative.cu
  • cub/test/catch2_test_device_segmented_scan_utils.cuh

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

@github-actions

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 3h 57m: Pass: 100%/141 | Total: 8d 23h | Max: 3h 42m | Hits: 38%/2082381

See results here.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

[Task] Change non-API segmented scan tests to use cuda buffers

1 participant