Skip to content

Commit 567562d

Browse files
BlonckMartin Marenz
authored andcommitted
Remove checks against _LIBCUDACXX_STD_VER < 11 (NVIDIA#375)
As part of NVIDIA#127, code for unsupported compilation modes/platforms will be removed. `_LICUDACXX_STD_VER` macro defines which C++ standard is used. This patch removes all checks against C++ versions before 11 and the corresponding code. Co-authored-by: Martin Marenz <martin.marenz@webfleet.com>
1 parent f35ad5f commit 567562d

File tree

7 files changed

+7
-15
lines changed

7 files changed

+7
-15
lines changed

libcudacxx/include/cuda/std/detail/libcxx/include/__config

+4
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ extern "C++" {
135135
# endif
136136
#endif // _LIBCUDACXX_STD_VER
137137

138+
#if _LIBCUDACXX_STD_VER < 11
139+
# error libcu++ requires C++11 or later
140+
#endif
141+
138142
#if (defined(_LIBCUDACXX_COMPILER_NVHPC) && defined(__linux__)) \
139143
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
140144
#define __ELF__

libcudacxx/include/cuda/std/detail/libcxx/include/__type_traits/is_constant_evaluated.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
_LIBCUDACXX_BEGIN_NAMESPACE_STD
2222

2323
#if defined(_LIBCUDACXX_IS_CONSTANT_EVALUATED)
24-
#if (defined(__cuda_std__) && _LIBCUDACXX_STD_VER >= 11) || _LIBCUDACXX_STD_VER > 17
24+
#if defined(__cuda_std__) || _LIBCUDACXX_STD_VER > 17
2525
_LIBCUDACXX_INLINE_VISIBILITY
2626
inline constexpr bool is_constant_evaluated() noexcept {
2727
return _LIBCUDACXX_IS_CONSTANT_EVALUATED();

libcudacxx/include/cuda/std/detail/libcxx/include/barrier

-4
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@ namespace std
7373
# error <barrier> is not supported on this single threaded system
7474
#endif
7575

76-
#if _LIBCUDACXX_STD_VER < 11
77-
# error <barrier> requires C++11 or later
78-
#endif
79-
8076
_LIBCUDACXX_BEGIN_NAMESPACE_STD
8177

8278
struct __empty_completion

libcudacxx/include/cuda/std/detail/libcxx/include/latch

-4
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@ namespace std
5858
# error <latch> is not supported on this single threaded system
5959
#endif
6060

61-
#if _LIBCUDACXX_STD_VER < 11
62-
# error <latch> is requires C++11 or later
63-
#endif
64-
6561
_LIBCUDACXX_BEGIN_NAMESPACE_STD
6662

6763
# if _LIBCUDACXX_CUDA_ABI_VERSION < 3

libcudacxx/include/cuda/std/detail/libcxx/include/semaphore

-4
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@ using binary_semaphore = counting_semaphore<1>;
6666
# error <semaphore> is not supported on this single threaded system
6767
#endif
6868

69-
#if _LIBCUDACXX_STD_VER < 11
70-
# error <semaphore> is requires C++11 or later
71-
#endif
72-
7369
_LIBCUDACXX_BEGIN_NAMESPACE_STD
7470

7571
template<int _Sco, ptrdiff_t __least_max_value>

libcudacxx/libcxx/src/atomic.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
_LIBCUDACXX_BEGIN_NAMESPACE_STD
1313

14-
#if !defined(_LIBCUDACXX_HAS_NO_THREAD_CONTENTION_TABLE) && (_LIBCUDACXX_STD_VER >= 11)
14+
#if !defined(_LIBCUDACXX_HAS_NO_THREAD_CONTENTION_TABLE)
1515

1616
__libcpp_contention_t __libcpp_contention_state_[ 256 /* < there's no magic in this number */ ];
1717

libcudacxx/libcxx/src/barrier.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
_LIBCUDACXX_BEGIN_NAMESPACE_STD
1313

14-
#if !defined(_LIBCUDACXX_HAS_NO_TREE_BARRIER) && !defined(_LIBCUDACXX_HAS_NO_THREAD_FAVORITE_BARRIER_INDEX) && (_LIBCUDACXX_STD_VER >= 11)
14+
#if !defined(_LIBCUDACXX_HAS_NO_TREE_BARRIER) && !defined(_LIBCUDACXX_HAS_NO_THREAD_FAVORITE_BARRIER_INDEX)
1515

1616
_LIBCUDACXX_EXPORTED_FROM_ABI
1717
thread_local ptrdiff_t __libcpp_thread_favorite_barrier_index = 0;

0 commit comments

Comments
 (0)