Skip to content

libcu++: atomic backend dispatch refactor - #10908

Open
griwes wants to merge 22 commits into
NVIDIA:mainfrom
griwes:feature/atomic-backend-refactor
Open

libcu++: atomic backend dispatch refactor#10908
griwes wants to merge 22 commits into
NVIDIA:mainfrom
griwes:feature/atomic-backend-refactor

Conversation

@griwes

@griwes griwes commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Description

This PR massively refactors the internals of the implementation of cuda::{,std::}atomic{,_ref}. Main points are as follows:

  • Backends are first class. They are identified by structures that also carry information about how the dispatching logic will work.
  • The dispatching logic no longer chooses between different names for host/device paths; all interfaces now dispatch through the same names, using the backend tag structures as the dispatch point.
  • The PTX fallback logic has been promoted to a "generic" backend, which can fill holes in the native coverage when needed. It also now owns the logic for "need to do an operation, but have to widen to have a native instruction".
  • The generic backend now also owns a generic CAS-based RMW implementation, which is then used by the various RMW APIs that don't have native instructions available.
  • The top level dispatch to host/device is now uniform between the two, so it has been folded into dispatch macros, so that we no longer need to manually dispatch between host and device for every single API.
  • For sub-word atomic_ref, the CAS RMW protocol is now placing the seq_cst membar in the correct spot (inside the retry loop, instead of prior to the initial load).
  • Common dispatching mechanisms have been lifted out of the PTX backend into top level abstractions (will be needed by the NVVM backend too).

This is a large PR; I have attempted to split all the changes into smaller commits that should be at least somewhat reviewable. Reviewing this commit by commit is recommended.

Checklist

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

@copy-pr-bot

copy-pr-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Progress in CCCL Aug 20, 2026
@griwes

griwes commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test a4384f0

@griwes
griwes requested review from davebayer, miscco and wmaxey August 20, 2026 00:29
@griwes

griwes commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 99bb8b9

@griwes

griwes commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 7ed88e2

@github-actions

This comment has been minimized.

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

Suggestion: I would start with a PR that just does the rename to __cuda_atomic then followed by some of the cleanups like adding _CCCL_HOST_DEVICE_API and so on

That would massively limit the scope of this PR

Comment thread libcudacxx/codegen/generators/compare_and_swap.h Outdated
Comment thread libcudacxx/codegen/generators/compare_and_swap.h Outdated
Comment thread libcudacxx/codegen/generators/compare_and_swap.h Outdated
Comment thread libcudacxx/include/cuda/std/__atomic/functions/backend.h Outdated
Comment thread libcudacxx/include/cuda/std/__atomic/functions/backend.h
@griwes

griwes commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

@miscco I can pull out the renaming into its own commit in the series; that should be fairly reviewable, and not having to track multiple dependent PRs would make my life easier. But if you'd really prefer, I can extract it to a separate PR.

@griwes

griwes commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 451b96a

@griwes

griwes commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 5aead21

@github-actions

This comment has been minimized.

@griwes

griwes commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test d01603d

@griwes

griwes commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

The renaming aspect of this has now been extracted into #10922.

@griwes
griwes force-pushed the feature/atomic-backend-refactor branch from d01603d to 18acbb3 Compare August 20, 2026 22:13
@griwes

griwes commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 18acbb3

@github-actions

This comment has been minimized.

@griwes

griwes commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 7b27341

@github-actions

This comment has been minimized.

@griwes
griwes force-pushed the feature/atomic-backend-refactor branch from 7b27341 to 8ca244c Compare August 25, 2026 04:41
@griwes

griwes commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 8ca244c

@github-actions

This comment has been minimized.

@miscco

miscco commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

I have 2 comments regarding improvements we should make when we are touching this:

  1. Currently all the __cuda_atomic_bind_meow helper structs are templated on template <typename _Type, typename _Tag, typename _Sco> However, only  the underlying atomic _Type is actually needed in the struct definition to store the pointers and we could move _Tag and _Sco to the call operator. That would considerably reduce the number of type instantiations we have to do

  2. I see a lot of unqualified function calls in the backend. That means the compiler has to check for ADL during overload resolution. Given that currently all is based on tag dispatch this is probably relatively costly

@griwes

griwes commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 1e6afb5

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Improved correctness and consistency of CUDA atomic operations across host and device execution.
    • Strengthened memory-order and sequential-consistency behavior for fences, loads, stores, exchanges, and compare-exchanges.
    • Improved support for local-memory operations, wider atomic values, extended floating-point comparisons, and fetch-sub operations.
  • Refactor

    • Unified atomic operation handling across supported execution environments and memory-ordering modes.
  • Tests

    • Updated code-generation checks for barrier, cache, and operation ordering.

Walkthrough

Changes

The PR replaces separate CUDA and host atomic implementations with shared backend dispatch. It adds PTX order handling, generic CAS-based fallbacks, typed local-memory operations, updated generated intrinsics, and ordered SASS validation.

Unified atomic backend

Layer / File(s) Summary
Backend contracts and operand types
libcudacxx/include/cuda/std/__atomic/functions/backend.h, libcudacxx/include/cuda/std/__atomic/functions/*_backend.h, libcudacxx/include/cuda/std/__atomic/functions/common.h, libcudacxx/include/cuda/std/__atomic/scopes.h
Defines backend capabilities, memory-order tags, CAS descriptors, operand deduction, unwrapped value types, and shared scope tags.
PTX, generic, and order dispatch
libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx.h, cuda_ptx_backend.h, dispatch.h, generic.h, generic_rmw.h
Adds PTX order transformation and fences, generic atomic operations, widened CAS loops, fetch-sub handling, and backend-aware operation dispatch.
Generated intrinsic and dispatch integration
libcudacxx/codegen/generators/*
Updates generated load, store, exchange, compare-exchange, fetch, and fence code to use backend parameters, __unv operands, PTX semantic tags, and local-memory workarounds.
Host, local-memory, and public API wiring
libcudacxx/include/cuda/std/__atomic/functions.h, host.h, cuda_local.h, libcudacxx/include/cuda/std/__atomic/types/*, libcudacxx/include/cuda/__atomic/atomic.h
Routes public atomic operations through host/device backends, converts local operations to typed values, and uses __cuda_atomic_less for extended floating-point min/max.
SASS ordering validation
libcudacxx/test/atomic_codegen/sass/*_8_16_atomic_ref.cu, libcudacxx/test/atomic_codegen/sass/arithmetic_minmax* floating_types.cu
Changes FileCheck assertions to match release, sequential-consistency, cache-invalidation, load, CAS, and register sequences in order.

Suggested reviewers: davebayer, wmaxey

Merge Risk: 🟠 High · up to eb3a1

This refactor changes atomic backend dispatching, but generated headers may currently be emitted with unbalanced compilation guards, which can prevent consumers from compiling; related operand handling and validation issues could also cause incorrect results or reject valid code generation. These concrete correctness and build risks should be fixed before merging.


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

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
libcudacxx/codegen/generators/header.h (1)

75-88: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

critical: The emitted #if _CCCL_CUDA_COMPILATION() guards now form a chain across generators, and FormatTail no longer emits the closing #endif. If the chain does not close, the generated header does not compile.

  • libcudacxx/codegen/generators/header.h#L75-L88: re-add the closing #endif // _CCCL_CUDA_COMPILATION() in FormatTail, or confirm that the last generator closes the final guard.
  • libcudacxx/codegen/generators/fetch_ops.h#L134-L142: confirm that the per-operation #if emitted here is matched by the #endif at the start of fetch_bind_invoke for every operation, including the last one.
🧹 Nitpick comments (2)
libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx.h (1)

24-33: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

suggestion: Add the missing direct includes. This file uses is_same_v (lines 42-47, 70-72) and NV_DISPATCH_TARGET (line 49), but it includes neither <cuda/std/__type_traits/is_same.h> nor <nv/target>. Both symbols arrive only through transitive includes today.

 `#include` <cuda/std/__type_traits/enable_if.h>
 `#include` <cuda/std/__type_traits/is_integral.h>
+#include <cuda/std/__type_traits/is_same.h>
 `#include` <cuda/std/__type_traits/is_void.h>
 `#include` <cuda/std/__type_traits/make_unsigned.h>
+
+#include <nv/target>

As per coding guidelines: "Include all headers needed by the symbols being used; do not rely on transitive includes."

Source: Coding guidelines

libcudacxx/codegen/generators/ld_st.h (1)

259-259: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

suggestion: The generated __cuda_atomic_store takes the value as a non-const lvalue reference (__unv<_Type>& __val). The value is an input, and the binder at line 398 holds it by value, so the reference only works because operator() is not const-qualified. Take the value by value, as the exchange and fetch intrinsics do, so a const binder or a temporary also binds.

Also applies to: 278-279, 283-283


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 06587c78-beb3-461c-9d6e-8ddb6008182d

📥 Commits

Reviewing files that changed from the base of the PR and between 3a9ae70 and be10761.

📒 Files selected for processing (32)
  • 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/header.h
  • libcudacxx/codegen/generators/ld_st.h
  • libcudacxx/include/cuda/__atomic/atomic.h
  • libcudacxx/include/cuda/std/__atomic/functions.h
  • libcudacxx/include/cuda/std/__atomic/functions/backend.h
  • libcudacxx/include/cuda/std/__atomic/functions/common.h
  • libcudacxx/include/cuda/std/__atomic/functions/cuda_local.h
  • libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx.h
  • libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx_backend.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/functions/dispatch.h
  • libcudacxx/include/cuda/std/__atomic/functions/generic.h
  • libcudacxx/include/cuda/std/__atomic/functions/generic_rmw.h
  • libcudacxx/include/cuda/std/__atomic/functions/host.h
  • libcudacxx/include/cuda/std/__atomic/functions/host_backend.h
  • libcudacxx/include/cuda/std/__atomic/scopes.h
  • libcudacxx/include/cuda/std/__atomic/types/base.h
  • libcudacxx/include/cuda/std/__atomic/types/common.h
  • libcudacxx/include/cuda/std/__atomic/types/small.h
  • libcudacxx/test/atomic_codegen/sass/bitwise_types_8_16_atomic_ref.cu
  • libcudacxx/test/atomic_codegen/sass/bitwise_volatile_types_8_16_atomic_ref.cu
  • libcudacxx/test/atomic_codegen/sass/compare_exchange_types_8_16_atomic_ref.cu
  • libcudacxx/test/atomic_codegen/sass/compare_exchange_volatile_types_8_16_atomic_ref.cu
  • libcudacxx/test/atomic_codegen/sass/exchange_types_8_16_atomic_ref.cu
  • libcudacxx/test/atomic_codegen/sass/exchange_volatile_types_8_16_atomic_ref.cu
💤 Files with no reviewable changes (2)
  • libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx_derived.h
  • libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx_generated_helper.h

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

Comment thread libcudacxx/codegen/generators/fetch_ops.h
Comment thread libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx_backend.h
@github-actions

This comment has been minimized.

Comment thread libcudacxx/codegen/generators/fence.h Outdated
Comment thread libcudacxx/codegen/generators/exchange.h Outdated
Comment thread libcudacxx/include/cuda/std/__atomic/functions/backend.h Outdated
Comment thread libcudacxx/include/cuda/std/__atomic/functions/backend.h
Comment thread libcudacxx/include/cuda/std/__atomic/functions/backend.h Outdated
_CCCL_BEGIN_NAMESPACE_CUDA_STD

template <typename _Tp>
using __unv = remove_volatile_t<_Tp>;

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.

__unv is... a very cryptic name, and this isn't F77 anymore. IMO, we should just keep this as remove_volatile_t, we don't save much on readability by shortening this.

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.

There is A LOT of remove_volatile_t throughout the backend. Yes, the name is cryptic at first glance, but having stared at the code with both the full spelling and with this alias in place, it (1) makes already really long lines sometimes 24 characters shorter, and (2) at the very least to my eyes it presents in such a way that I immediately scan the argument to it and peg it as the important part of the parameter definition, which I fail to do with the full spelling.

I get that this seems unnecessary, but I suggest you look at some of the denser pieces of the code here as it is in this PR, and then separately after doing s/__unv/remove_volatile_t/g to see the difference. At least to me it is massive. I wouldn't normally do this, but I had actual trouble following what was going on in the code, which prompted me to shorten the name down to this.

Comment thread libcudacxx/include/cuda/std/__atomic/functions/cuda_local.h Outdated
Comment thread libcudacxx/include/cuda/std/__atomic/functions/dispatch.h Outdated
Comment thread libcudacxx/include/cuda/std/__atomic/functions/dispatch.h Outdated
Comment thread libcudacxx/include/cuda/std/__atomic/functions/dispatch.h Outdated
@griwes

griwes commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

@Jacobfaib addressed most of your review comments.

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: d5ebbfcf-3758-43b3-a109-7873baf8cb12

📥 Commits

Reviewing files that changed from the base of the PR and between be10761 and 41ecfb0.

📒 Files selected for processing (17)
  • libcudacxx/codegen/generators/compare_and_swap.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/std/__atomic/functions/backend.h
  • libcudacxx/include/cuda/std/__atomic/functions/cuda_local.h
  • libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx.h
  • libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx_backend.h
  • libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx_generated.h
  • libcudacxx/include/cuda/std/__atomic/functions/dispatch.h
  • libcudacxx/include/cuda/std/__atomic/functions/generic.h
  • libcudacxx/include/cuda/std/__atomic/functions/generic_rmw.h
  • libcudacxx/test/atomic_codegen/sass/arithmetic_minmax_types_8_16_atomic_ref.cu
  • libcudacxx/test/atomic_codegen/sass/arithmetic_minmax_volatile_types_8_16_atomic_ref.cu
  • libcudacxx/test/atomic_codegen/sass/arithmetic_types_8_16_atomic_ref.cu
  • libcudacxx/test/atomic_codegen/sass/arithmetic_volatile_types_8_16_atomic_ref.cu
🚧 Files skipped from review as they are similar to previous changes (2)
  • libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx_backend.h
  • libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx.h

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

@griwes

griwes commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai update your merge risk assessment. Your earlier "unterminated #ifs" comment is incorrect.

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '=== Candidate files ==='
fd -a '^(header|dispatch|backend)\.h$' libcudacxx 2>/dev/null | sed -n '1,160p'

echo '=== Generator header conditional directives ==='
if [ -f libcudacxx/codegen/generators/header.h ]; then
  nl -ba libcudacxx/codegen/generators/header.h | grep -E '^[[:space:]]*[0-9]+[[:space:]]+.*#[[:space:]]*(if|ifdef|ifndef|elif|else|endif)\b' || true
fi

echo '=== Atomic function header conditional directives ==='
fd -a -e h . libcudacxx/include/cuda/std/__atomic/functions -x sh -c '
  for f do
    if grep -qE "^[[:space:]]*#[[:space:]]*(if|ifdef|ifndef|elif|else|endif)\b" "$f"; then
      echo "--- $f"
      grep -nE "^[[:space:]]*#[[:space:]]*(if|ifdef|ifndef|elif|else|endif)\b" "$f"
    fi
  done
' sh {} \;

echo '=== Relevant generated-header include/guard structure ==='
fd -a 'atomic.*\\.h|.*generated.*\\.h' libcudacxx/include 2>/dev/null | sed -n '1,120p'

echo '=== PR and blocking issue state ==='
gh pr view 10908 --repo NVIDIA/cccl --json number,state,isDraft,mergeStateStatus,reviewDecision,statusCheckRollup,headRefName,baseRefName,url
gh issue view 10506 --repo NVIDIA/cccl --json number,state,title,url

Length of output: 77032


suggestion: The earlier “unterminated #ifs” finding was incorrect. The generated cuda_ptx_generated.h has balanced _CCCL_CUDA_COMPILATION() directives and a closed include guard. I withdraw that finding.

The merge risk is now medium because this is a broad atomic dispatch refactor. I found no current preprocessor-structure blocker. The atomic PTX code-generation checks and VerifyCodegen checks have passed.

Issue #10506 is closed. It no longer blocks this PR.

The current merge gates are the required review and the CI jobs that are still running or queued.

You are interacting with an AI system.

@github-actions

This comment has been minimized.

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
libcudacxx/include/cuda/std/__atomic/functions/dispatch.h (1)

251-253: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

suggestion: Qualify the order-dispatch calls with ::cuda::std::.

Line 252 calls __cuda_atomic_load_order_dispatch unqualified. The same pattern repeats at lines 299, 349, 388, 439, 479, 519, 559, 599, and 639. Other free-function calls in this file are fully qualified, for example ::cuda::std::__cuda_atomic_rmw_order_dispatch at line 132 and ::cuda::std::__cuda_atomic_load_dispatch at line 261. Unqualified calls take arguments that are class types in this namespace, so ADL runs on every call.

Proposed change
-  __cuda_atomic_load_order_dispatch(
+  ::cuda::std::__cuda_atomic_load_order_dispatch(
     __backend, __bound_load, __order, __scope, __proxy_tag{}, __cuda_atomic_mmio_disable{});

As per coding guidelines: "In headers, apply the required global qualification rules for free-function calls, including ::cuda::... qualification where mandated by the subproject."

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7303ff20-326f-4af2-aa55-d0b5326c8727

📥 Commits

Reviewing files that changed from the base of the PR and between 411482f and e42d75e.

📒 Files selected for processing (7)
  • libcudacxx/codegen/generators/compare_and_swap.h
  • libcudacxx/codegen/generators/exchange.h
  • libcudacxx/codegen/generators/fetch_ops.h
  • libcudacxx/codegen/generators/header.h
  • libcudacxx/codegen/generators/ld_st.h
  • libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx_generated.h
  • libcudacxx/include/cuda/std/__atomic/functions/dispatch.h

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

Comment thread libcudacxx/include/cuda/std/__atomic/functions/dispatch.h

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

🧹 Nitpick comments (1)
libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx.h (1)

140-143: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

suggestion: Mark __cuda_atomic_signal_fence as noexcept. _CCCL_DEVICE_API does not provide noexcept, and the function body cannot throw.

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 1fb885f3-08ff-47d0-9ff3-c31016f827ee

📥 Commits

Reviewing files that changed from the base of the PR and between e42d75e and eb3a1c3.

📒 Files selected for processing (2)
  • libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx.h
  • libcudacxx/include/cuda/std/__atomic/functions/dispatch.h
💤 Files with no reviewable changes (1)
  • libcudacxx/include/cuda/std/__atomic/functions/dispatch.h

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

@github-actions

This comment has been minimized.

…d-refactor-review

# Conflicts:
#	libcudacxx/codegen/generators/compare_and_swap.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/std/__atomic/functions/cuda_ptx_derived.h
#	libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx_generated.h
@github-actions

This comment has been minimized.

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

Overal the refactor looks fine.

I have some concerns about compile time traps with a lot of the templated types we are introducing here.

I would greatly help if we could split this up into smalller commits and post this as separate PRs

Comment thread libcudacxx/codegen/generators/compare_and_swap.h
Comment thread libcudacxx/codegen/generators/compare_and_swap.h Outdated
Comment thread libcudacxx/codegen/generators/compare_and_swap.h Outdated
Comment thread libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx.h Outdated
Comment thread libcudacxx/include/cuda/std/__atomic/functions/cuda_ptx.h Outdated
Comment thread libcudacxx/include/cuda/std/__atomic/functions/generic_rmw.h Outdated
Comment thread libcudacxx/include/cuda/std/__atomic/functions/generic_rmw.h Outdated
Comment thread libcudacxx/include/cuda/std/__atomic/functions/generic_rmw.h Outdated
Comment thread libcudacxx/include/cuda/std/__atomic/functions/generic_rmw.h Outdated
Comment thread libcudacxx/include/cuda/std/__atomic/functions/host.h Outdated
@griwes

griwes commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@miscco some of your comments were clearly on an old revision, please recheck the areas of concern on top of branch. Most specifically, the binders have had as much of the template parameters pushed down to the op() level. Other than that, the specific comments about maybe too many types I can see are about types I am specifically using as tags for the various parts of dispatching, and there's a constant number of all of those.

@griwes

griwes commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

@miscco I believe your review is now addressed, between the new commit and comments on your findings.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 2h 07m: Pass: 100%/195 | Total: 5d 11h | Max: 1h 50m | Hits: 44%/1235318

See results here.

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.

4 participants