Skip to content

[Backport to 3.4] Fix scanning out-of-bounds items in OpenMP scan (#9759) - #9819

Merged
wmaxey merged 2 commits into
NVIDIA:branch/3.4.xfrom
bernhardmgruber:backport_omp_fix
Jul 14, 2026
Merged

[Backport to 3.4] Fix scanning out-of-bounds items in OpenMP scan (#9759)#9819
wmaxey merged 2 commits into
NVIDIA:branch/3.4.xfrom
bernhardmgruber:backport_omp_fix

Conversation

@bernhardmgruber

Copy link
Copy Markdown
Contributor

(cherry picked from commit a0fd4f2)

* Fix scanning out-of-bounds items in OpenMP scan

Fixes: NVIDIA#9725

* Review

(cherry picked from commit a0fd4f2)
@bernhardmgruber
bernhardmgruber requested a review from a team as a code owner July 13, 2026 12:56
@bernhardmgruber
bernhardmgruber requested a review from elstehle July 13, 2026 12:56
@github-project-automation github-project-automation Bot moved this to Todo in CCCL Jul 13, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Jul 13, 2026
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 9f34bc56-75a2-4b15-bc36-975b9a5f6add

📥 Commits

Reviewing files that changed from the base of the PR and between 305c95b and 4137a0d.

📒 Files selected for processing (1)
  • thrust/thrust/system/omp/detail/scan.h

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Improved parallel scan behavior across varying input sizes.
    • Enhanced work distribution to ensure all portions of the input are processed consistently.
    • Preserved existing inclusive and exclusive scan behavior.
  • Performance

    • Improved efficiency by using only the number of processing threads needed for each scan.

Walkthrough

Changes

The OMP scan now computes block_size and active_threads once, sizes block sums accordingly, and uses the active thread count for block reduction and per-block scanning.

OMP scan partitioning

Layer / File(s) Summary
Active block decomposition and scanning
thrust/thrust/system/omp/detail/scan.h
scan_impl derives active block bounds, sizes block_sums, and runs Steps 1 and 3 with active_threads; inclusive and exclusive scan branches remain supported.

Possibly related PRs

  • NVIDIA/cccl#9759: Updates the same OMP scan partitioning and removes redundant range guards.

Suggested labels: backport branch/3.4.x

Suggested reviewers: elstehle, miscco, davebayer, jacobfaib, wmaxey


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

@bernhardmgruber

Copy link
Copy Markdown
Contributor Author

pre.commit-ci autofix

@github-actions

This comment has been minimized.

@bernhardmgruber

Copy link
Copy Markdown
Contributor Author

pre-commit.ci autofix

@bernhardmgruber

Copy link
Copy Markdown
Contributor Author

/ok to test 017691f

@github-actions

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 1h 14m: Pass: 100%/115 | Total: 19h 08m | Max: 45m 24s | Hits: 99%/187842

See results here.

@wmaxey
wmaxey merged commit bf8e9d2 into NVIDIA:branch/3.4.x Jul 14, 2026
132 of 135 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in CCCL Jul 14, 2026
@bernhardmgruber
bernhardmgruber deleted the backport_omp_fix branch July 14, 2026 16:31
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.

3 participants