Skip to content

[libcu++] Fix use of exception keywords#9220

Merged
bernhardmgruber merged 1 commit into
NVIDIA:mainfrom
davebayer:fix_use_of_try
Jun 3, 2026
Merged

[libcu++] Fix use of exception keywords#9220
bernhardmgruber merged 1 commit into
NVIDIA:mainfrom
davebayer:fix_use_of_try

Conversation

@davebayer
Copy link
Copy Markdown
Contributor

Replace them with our exception macros instead.

@davebayer davebayer requested a review from a team as a code owner June 2, 2026 20:02
@davebayer davebayer requested a review from wmaxey June 2, 2026 20:02
@github-project-automation github-project-automation Bot moved this to Todo in CCCL Jun 2, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Jun 2, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 2, 2026

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: 5c72f438-d1b2-47eb-b157-fc192be86541

📥 Commits

Reviewing files that changed from the base of the PR and between 2a82ae1 and 0de172c.

📒 Files selected for processing (2)
  • libcudacxx/include/cuda/std/__pstl/cuda/copy_if.h
  • libcudacxx/include/cuda/std/__pstl/cuda/sort.h

📝 Walkthrough

Summary by CodeRabbit

  • Chores
    • Standardized exception-handling implementation in CUDA parallel algorithms to use project-standard macros for consistency and maintainability. No functional changes or API alterations.

Walkthrough

Two PSTL algorithm dispatch headers replace raw exception-handling statements with project-standard macros. copy_if replaces throw; with _CCCL_RETHROW;, and sort converts its try/catch block to use _CCCL_TRY, _CCCL_CATCH, and _CCCL_CATCH_FALLTHROUGH while preserving the original memory-allocation and error-rethrow semantics.

Changes

Exception handling macro standardization

Layer / File(s) Summary
copy_if exception rethrow standardization
libcudacxx/include/cuda/std/__pstl/cuda/copy_if.h
Non-memory-allocation errors in the copy_if dispatch rethrow via _CCCL_RETHROW macro instead of bare throw;.
sort exception handling macro conversion
libcudacxx/include/cuda/std/__pstl/cuda/sort.h
sort dispatch operator() replaces native try/catch structure with _CCCL_TRY, _CCCL_CATCH, and _CCCL_CATCH_FALLTHROUGH macros. Memory allocation errors continue to map to std::bad_alloc; other cuda_error cases rethrow via _CCCL_RETHROW.

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 2, 2026

🥳 CI Workflow Results

🟩 Finished in 1h 27m: Pass: 100%/115 | Total: 1d 11h | Max: 50m 13s | Hits: 86%/397076

See results here.

@bernhardmgruber bernhardmgruber merged commit cfe7e26 into NVIDIA:main Jun 3, 2026
137 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in CCCL Jun 3, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 3, 2026

Successfully created backport PR for branch/3.4.x:

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

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants