Skip to content

Commit

Permalink
Remove checks against _LIBCUDACXX_STD_VER < 11 (#375)
Browse files Browse the repository at this point in the history
As part of #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 <[email protected]>
  • Loading branch information
2 people authored and ahendriksen committed Aug 28, 2023
1 parent f35ad5f commit 567562d
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 15 deletions.
4 changes: 4 additions & 0 deletions libcudacxx/include/cuda/std/detail/libcxx/include/__config
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ extern "C++" {
# endif
#endif // _LIBCUDACXX_STD_VER

#if _LIBCUDACXX_STD_VER < 11
# error libcu++ requires C++11 or later
#endif

#if (defined(_LIBCUDACXX_COMPILER_NVHPC) && defined(__linux__)) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define __ELF__
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
_LIBCUDACXX_BEGIN_NAMESPACE_STD

#if defined(_LIBCUDACXX_IS_CONSTANT_EVALUATED)
#if (defined(__cuda_std__) && _LIBCUDACXX_STD_VER >= 11) || _LIBCUDACXX_STD_VER > 17
#if defined(__cuda_std__) || _LIBCUDACXX_STD_VER > 17
_LIBCUDACXX_INLINE_VISIBILITY
inline constexpr bool is_constant_evaluated() noexcept {
return _LIBCUDACXX_IS_CONSTANT_EVALUATED();
Expand Down
4 changes: 0 additions & 4 deletions libcudacxx/include/cuda/std/detail/libcxx/include/barrier
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ namespace std
# error <barrier> is not supported on this single threaded system
#endif

#if _LIBCUDACXX_STD_VER < 11
# error <barrier> requires C++11 or later
#endif

_LIBCUDACXX_BEGIN_NAMESPACE_STD

struct __empty_completion
Expand Down
4 changes: 0 additions & 4 deletions libcudacxx/include/cuda/std/detail/libcxx/include/latch
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ namespace std
# error <latch> is not supported on this single threaded system
#endif

#if _LIBCUDACXX_STD_VER < 11
# error <latch> is requires C++11 or later
#endif

_LIBCUDACXX_BEGIN_NAMESPACE_STD

# if _LIBCUDACXX_CUDA_ABI_VERSION < 3
Expand Down
4 changes: 0 additions & 4 deletions libcudacxx/include/cuda/std/detail/libcxx/include/semaphore
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ using binary_semaphore = counting_semaphore<1>;
# error <semaphore> is not supported on this single threaded system
#endif

#if _LIBCUDACXX_STD_VER < 11
# error <semaphore> is requires C++11 or later
#endif

_LIBCUDACXX_BEGIN_NAMESPACE_STD

template<int _Sco, ptrdiff_t __least_max_value>
Expand Down
2 changes: 1 addition & 1 deletion libcudacxx/libcxx/src/atomic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

_LIBCUDACXX_BEGIN_NAMESPACE_STD

#if !defined(_LIBCUDACXX_HAS_NO_THREAD_CONTENTION_TABLE) && (_LIBCUDACXX_STD_VER >= 11)
#if !defined(_LIBCUDACXX_HAS_NO_THREAD_CONTENTION_TABLE)

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

Expand Down
2 changes: 1 addition & 1 deletion libcudacxx/libcxx/src/barrier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

_LIBCUDACXX_BEGIN_NAMESPACE_STD

#if !defined(_LIBCUDACXX_HAS_NO_TREE_BARRIER) && !defined(_LIBCUDACXX_HAS_NO_THREAD_FAVORITE_BARRIER_INDEX) && (_LIBCUDACXX_STD_VER >= 11)
#if !defined(_LIBCUDACXX_HAS_NO_TREE_BARRIER) && !defined(_LIBCUDACXX_HAS_NO_THREAD_FAVORITE_BARRIER_INDEX)

_LIBCUDACXX_EXPORTED_FROM_ABI
thread_local ptrdiff_t __libcpp_thread_favorite_barrier_index = 0;
Expand Down

0 comments on commit 567562d

Please sign in to comment.