Skip to content

libcu++: atomic backend naming unification. - #10922

Merged
griwes merged 1 commit into
NVIDIA:mainfrom
griwes:refactor/atomic-backend-renames
Aug 24, 2026
Merged

libcu++: atomic backend naming unification.#10922
griwes merged 1 commit into
NVIDIA:mainfrom
griwes:refactor/atomic-backend-renames

Conversation

@griwes

@griwes griwes commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Description

This is a mechanical extraction of the renaming aspects of #10908 into its own PR.

Checklist

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

@griwes
griwes requested a review from a team as a code owner August 20, 2026 20:36
@griwes
griwes requested a review from fbusato August 20, 2026 20:36
@github-project-automation github-project-automation Bot moved this to Todo in CCCL Aug 20, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Aug 20, 2026
@griwes
griwes requested review from davebayer, miscco and wmaxey August 20, 2026 20:36
@coderabbitai

coderabbitai Bot commented Aug 20, 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: 15d97478-f154-4f7a-85ae-5cdf557d05c0

📥 Commits

Reviewing files that changed from the base of the PR and between 452c02a and febfb73.

📒 Files selected for processing (13)
  • libcudacxx/codegen/generators/compare_and_swap.h
  • libcudacxx/codegen/generators/definitions.h
  • libcudacxx/codegen/generators/exchange.h
  • libcudacxx/codegen/generators/fence.h
  • libcudacxx/codegen/generators/fetch_ops.h
  • libcudacxx/codegen/generators/ld_st.h
  • libcudacxx/include/cuda/__atomic/atomic.h
  • libcudacxx/include/cuda/std/__atomic/functions/cuda_local.h
  • libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx_derived.h
  • libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx_generated.h
  • libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx_generated_helper.h
  • libcudacxx/include/cuda/std/__atomic/order.h
  • libcudacxx/include/cuda/std/__atomic/types/base.h

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


📝 Walkthrough

Summary by CodeRabbit

  • Refactor
    • Standardized CUDA atomic operation naming across fences, loads, stores, exchanges, compare-exchanges, and fetch operations.
    • Updated memory-order and operand terminology for consistency.
    • Preserved existing atomic behavior, including volatile access, weak-operation handling, and host-side dispatch.
    • Updated device-side operations to use the standardized CUDA atomic interfaces.

Walkthrough

Changes

The PR renames generated CUDA atomic helpers, internal order and operand entities, local atomic helpers, and device dispatch calls from legacy CUDA prefixes to the __cuda_atomic_* naming scheme. Operation behavior and host-side dispatch remain unchanged.

CUDA atomic naming alignment

Layer / File(s) Summary
Atomic naming contracts
libcudacxx/codegen/generators/definitions.h, libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx_generated_helper.h, libcudacxx/include/cuda/std/__atomic/order.h
Internal order, MMIO, operand, deduction, type-selection, and stronger-order entities use the __cuda_atomic_* names.
Generated dispatch updates
libcudacxx/codegen/generators/{compare_and_swap,exchange,fence,fetch_ops,ld_st}.h
Generated load, store, exchange, compare-exchange, fetch, and fence helpers use the renamed dispatch, order, operand, proxy, and local-fast-path identifiers.
Device atomic helper updates
libcudacxx/include/cuda/std/__atomic/functions/cuda_local.h, libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx_derived.h
CUDA-local operations and PTX-derived fetch-update paths call the renamed helpers and retain existing operation behavior.
Public device dispatch wiring
libcudacxx/include/cuda/__atomic/atomic.h, libcudacxx/include/cuda/std/__atomic/types/base.h
Device fences, compare-exchange operations, and fetch operations invoke the renamed CUDA dispatch functions. Host dispatch remains unchanged.

Suggested reviewers: fbusato, miscco

Merge Risk: ⚪ Minimal · up to febfb

This PR performs a localized atomic backend naming update with no actionable merge-blocking risk remaining beyond normal checks and review.


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

@github-actions

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 2h 24m: Pass: 100%/117 | Total: 3d 03h | Max: 1h 30m | Hits: 59%/646965

See results here.

out << R"XXX(
template <class _Fn, class _Sco>
static inline _CCCL_DEVICE bool __cuda_atomic_compare_swap_memory_order_dispatch(_Fn& __cuda_cas, int __success_memorder, int __failure_memorder, _Sco) {
static inline _CCCL_DEVICE bool __cuda_atomic_compare_exchange_order_dispatch(_Fn& __cuda_cas, int __success_memorder, int __failure_memorder, _Sco) {

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'm not a fan of using __cuda prefix, I'd much rather see something like __cccl_atomic

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.

My logic here is that this means "this is a part of the cuda::atomic implementation". But additionally, __cuda_atomic just codifies an existing naming scheme that existed at the top layer of the backend; if we move to __cccl, this will be a larger rename.

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 a bit torn here.

We usually want to prefix with __cccl rather anything else to make sure where something belongs.

However, this is the implementation of cuda::atomic so this makes it appropriate in this context

@griwes

griwes commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

@miscco @wmaxey just wanted at least one of you to take a look, since we touched on this offline.

@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.

Fine with the naming.

@griwes
griwes merged commit 2a4cac6 into NVIDIA:main Aug 24, 2026
149 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in CCCL Aug 24, 2026
@griwes
griwes deleted the refactor/atomic-backend-renames branch August 24, 2026 18:25
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.

4 participants