Skip to content

Commit f391b90

Browse files
committed
only hard-error about <cuda/atomic> include when the workaround is needed
1 parent d9da54e commit f391b90

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

include/nvexec/detail/cuda_atomic.cuh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#include <cuda/atomic> // IWYU pragma: export
2424

25-
#if STDEXEC_LIBCUDACXX_NEEDS_ATOMIC_WORAROUND()
25+
#if STDEXEC_LIBCUDACXX_NEEDS_ATOMIC_WORKAROUND()
2626
_LIBCUDACXX_BEGIN_NAMESPACE_STD
2727

2828
namespace __detail {
@@ -76,4 +76,4 @@ namespace __detail {
7676
} // namespace __detail
7777

7878
_LIBCUDACXX_END_NAMESPACE_STD
79-
#endif // STDEXEC_LIBCUDACXX_NEEDS_ATOMIC_WORAROUND()
79+
#endif // STDEXEC_LIBCUDACXX_NEEDS_ATOMIC_WORKAROUND()

include/nvexec/detail/cuda_fwd.cuh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,21 @@
1818

1919
#pragma once
2020

21-
#ifdef _CUDA_ATOMIC
22-
# error This file must be included before <cuda/atomic> from libcudacxx
23-
#endif
24-
2521
#include "config.cuh"
2622
#include <cuda/std/detail/__config>
2723

2824
#if _LIBCUDACXX_STD_VER > 17 && _LIBCUDACXX_CUDA_API_VERSION < 1009000
29-
# define STDEXEC_LIBCUDACXX_NEEDS_ATOMIC_WORAROUND() 1
25+
# define STDEXEC_LIBCUDACXX_NEEDS_ATOMIC_WORKAROUND() 1
3026
#else
31-
# define STDEXEC_LIBCUDACXX_NEEDS_ATOMIC_WORAROUND() 0
27+
# define STDEXEC_LIBCUDACXX_NEEDS_ATOMIC_WORKAROUND() 0
3228
#endif
3329

34-
#if STDEXEC_LIBCUDACXX_NEEDS_ATOMIC_WORAROUND()
30+
#if STDEXEC_LIBCUDACXX_NEEDS_ATOMIC_WORKAROUND()
31+
32+
# ifdef _CUDA_ATOMIC
33+
# error This file must be included before <cuda/atomic> from libcudacxx
34+
# endif
35+
3536
_LIBCUDACXX_BEGIN_NAMESPACE_STD
3637

3738
enum class memory_order : unsigned int;
@@ -74,4 +75,4 @@ namespace __detail {
7475
} // namespace __detail
7576

7677
_LIBCUDACXX_END_NAMESPACE_STD
77-
#endif // STDEXEC_LIBCUDACXX_NEEDS_ATOMIC_WORAROUND()
78+
#endif // STDEXEC_LIBCUDACXX_NEEDS_ATOMIC_WORKAROUND()

0 commit comments

Comments
 (0)