Skip to content

Commit 2c03a4a

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

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

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)