libcu++: __nv_atomic based atomics backend. - #11075
Draft
griwes wants to merge 27 commits into
Draft
Conversation
…d-refactor-review
…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
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. |
Contributor
Author
|
/ok to test b2bed6d |
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
Contributor
Author
|
/ok to test 5b72d8e |
This comment has been minimized.
This comment has been minimized.
Contributor
Author
|
/ok to test f29671e |
Contributor
🥳 CI Workflow Results🟩 Finished in 2h 16m: Pass: 100%/195 | Total: 1d 05h | Max: 51m 57s | Hits: 100%/471502See results here. |
miscco
reviewed
Sep 1, 2026
Comment on lines
+44
to
+72
| template <> | ||
| struct __cuda_atomic_nvvm_order<__cuda_atomic_order_relaxed> | ||
| { | ||
| static constexpr int __value = __NV_ATOMIC_RELAXED; | ||
| }; | ||
|
|
||
| template <> | ||
| struct __cuda_atomic_nvvm_order<__cuda_atomic_order_release> | ||
| { | ||
| static constexpr int __value = __NV_ATOMIC_RELEASE; | ||
| }; | ||
|
|
||
| template <> | ||
| struct __cuda_atomic_nvvm_order<__cuda_atomic_order_acquire> | ||
| { | ||
| static constexpr int __value = __NV_ATOMIC_ACQUIRE; | ||
| }; | ||
|
|
||
| template <> | ||
| struct __cuda_atomic_nvvm_order<__cuda_atomic_order_acq_rel> | ||
| { | ||
| static constexpr int __value = __NV_ATOMIC_ACQ_REL; | ||
| }; | ||
|
|
||
| template <> | ||
| struct __cuda_atomic_nvvm_order<__cuda_atomic_order_seq_cst> | ||
| { | ||
| static constexpr int __value = __NV_ATOMIC_SEQ_CST; | ||
| }; |
Contributor
There was a problem hiding this comment.
Pretty sure those can be just inline variables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Resolves #7480.
This PR introduces an alternative to the PTX atomics backend, based on the
__nv_atomicfamily of intrinsics. It will be enabled starting with CTK 13.5.These changes have been verified with the top of tree build of the compiler.
Please note that right now, this PR also includes the necessary commits of #10908, but will be rebased once that PR is merged.
Checklist