KEMBAR78
Fix GCC/Clang only compilation of <cuda/std/atomic> by wmaxey · Pull Request #207 · NVIDIA/libcudacxx · GitHub
Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.

Conversation

@wmaxey
Copy link
Member

@wmaxey wmaxey commented Sep 22, 2021

GCC and Clang are unable to process <cuda/std/atomic> as it does not introduce the concept of Scopes into the cuda::std:: namespace.

When compiling without the NVCC driver a somewhat half-baked libcxx implementation is instead created. This is fixed by adding a macro to inform the implementation that the scopes need to be injected, while not including the rest of the CUDA mechanics.

MSVC has other issues so this fix is currently specific for GCC/Clang.

@wmaxey wmaxey self-assigned this Sep 22, 2021
@wmaxey wmaxey added testing: internal ci in progress Currently testing on internal NVIDIA CI (DVS). testing: internal ci passed Passed internal NVIDIA CI (DVS). and removed testing: internal ci in progress Currently testing on internal NVIDIA CI (DVS). labels Sep 22, 2021
@wmaxey wmaxey requested review from griwes and ogiroux September 22, 2021 18:05
Copy link
Collaborator

@griwes griwes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -0,0 +1,41 @@
#ifndef __ATOMIC_BLOCK
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this name or something like atomic_scopes.h is better. We only expose these in the cuda:: versions of the interface, true, but it's used throughout...

@wmaxey wmaxey merged commit 83cd4e7 into main Sep 28, 2021
@wmaxey wmaxey deleted the bugfix/atomic_gcc branch September 28, 2021 02:49
@wmaxey wmaxey added this to the 1.7.0 milestone Oct 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

testing: internal ci passed Passed internal NVIDIA CI (DVS).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants