Skip to content

Commit

Permalink
Remove _LIBCUDACXX_CXX03_LANG macro and all encapsulated code (NVIDIA…
Browse files Browse the repository at this point in the history
…#368)

* Remove _LIBCUDACXX_CXX03_LANG macro and all encapsulated code

As part of NVIDIA#127, code for unsupported compilation modes/platforms will
be removed. `_LICUDACXX_CXX03_LANG` macro is used to guard code only
compiled for C++03. The macro and all encapsulated code are removed.

* Remove `__functional_03` and `__functional_base_03`

This patch relates to NVIDIA#127.

---------

Co-authored-by: Martin Marenz <[email protected]>
  • Loading branch information
2 people authored and ahendriksen committed Aug 31, 2023
1 parent 327f44b commit 96bff14
Show file tree
Hide file tree
Showing 82 changed files with 45 additions and 3,473 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ int main (int, char**) {
ASSERT_SAME_TYPE(decltype(cuda::std::__libcpp_is_constant_evaluated()), bool);
ASSERT_NOEXCEPT(cuda::std::__libcpp_is_constant_evaluated());

#if defined(_LIBCUDACXX_IS_CONSTANT_EVALUATED) && !defined(_LIBCUDACXX_CXX03_LANG)
#if defined(_LIBCUDACXX_IS_CONSTANT_EVALUATED)
static_assert(cuda::std::__libcpp_is_constant_evaluated(), "");
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ set(files
__functional/unary_negate.h
__functional/unwrap_ref.h
__functional/weak_result_type.h
__functional_03
__functional_base
__functional_base_03
__fwd/array.h
__fwd/get.h
__fwd/hash.h
Expand Down
17 changes: 2 additions & 15 deletions libcudacxx/include/cuda/std/detail/libcxx/include/__config
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@ extern "C++" {
# endif
#endif // _LIBCUDACXX_STD_VER

#if _LIBCUDACXX_STD_VER < 11
#define _LIBCUDACXX_CXX03_LANG
#endif

#if (defined(_LIBCUDACXX_COMPILER_NVHPC) && defined(__linux__)) \
|| defined(_LIBCUDACXX_COMPILER_NVRTC)
#define __ELF__
Expand Down Expand Up @@ -1541,11 +1537,6 @@ typedef unsigned short char16_t;
typedef unsigned int char32_t;
#endif // _LIBCUDACXX_HAS_NO_UNICODE_CHARS

#ifdef _LIBCUDACXX_CXX03_LANG
# define static_assert(...) _Static_assert(__VA_ARGS__)
# define decltype(...) __decltype(__VA_ARGS__)
#endif // _LIBCUDACXX_CXX03_LANG

#if defined(_LIBCUDACXX_COMPILER_GCC) \
|| defined(_LIBCUDACXX_COMPILER_CLANG)
# define _LIBCUDACXX_NOALIAS __attribute__((__malloc__))
Expand Down Expand Up @@ -1678,11 +1669,7 @@ typedef unsigned int char32_t;
# define _LIBCUDACXX_DEPRECATED
#endif

#if !defined(_LIBCUDACXX_CXX03_LANG)
# define _LIBCUDACXX_DEPRECATED_IN_CXX11 _LIBCUDACXX_DEPRECATED
#else
# define _LIBCUDACXX_DEPRECATED_IN_CXX11
#endif
#define _LIBCUDACXX_DEPRECATED_IN_CXX11 _LIBCUDACXX_DEPRECATED

#if _LIBCUDACXX_STD_VER >= 14
# define _LIBCUDACXX_DEPRECATED_IN_CXX14 _LIBCUDACXX_DEPRECATED
Expand Down Expand Up @@ -1737,7 +1724,7 @@ typedef unsigned int char32_t;
// NODISCARD macros to the correct attribute.
#if __has_cpp_attribute(nodiscard) || (defined(_LIBCUDACXX_COMPILER_MSVC) && _LIBCUDACXX_STD_VER > 14)
# define _LIBCUDACXX_NODISCARD_ATTRIBUTE [[nodiscard]]
#elif defined(_LIBCUDACXX_COMPILER_CLANG) && !defined(_LIBCUDACXX_CXX03_LANG)
#elif defined(_LIBCUDACXX_COMPILER_CLANG)
# define _LIBCUDACXX_NODISCARD_ATTRIBUTE [[clang::warn_unused_result]]
#else
// We can't use GCC's [[gnu::warn_unused_result]] and
Expand Down
2 changes: 1 addition & 1 deletion libcudacxx/include/cuda/std/detail/libcxx/include/__debug
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#pragma GCC system_header
#endif

#if defined(_LIBCUDACXX_ENABLE_DEBUG_MODE) && !defined(_LIBCUDACXX_CXX03_LANG) && !defined(_LIBCUDACXX_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY)
#if defined(_LIBCUDACXX_ENABLE_DEBUG_MODE) && !defined(_LIBCUDACXX_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY)
# define _LIBCUDACXX_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ namespace placeholders

template <int _Np> struct __ph {};

#if defined(_LIBCUDACXX_CXX03_LANG) || defined(_LIBCUDACXX_BUILDING_LIBRARY)
#if defined(_LIBCUDACXX_BUILDING_LIBRARY)
_LIBCUDACXX_FUNC_VIS extern const __ph<1> _1;
_LIBCUDACXX_FUNC_VIS extern const __ph<2> _2;
_LIBCUDACXX_FUNC_VIS extern const __ph<3> _3;
Expand All @@ -98,7 +98,7 @@ _LIBCUDACXX_FUNC_VIS extern const __ph<10> _10;
/* _LIBCUDACXX_INLINE_VAR */ constexpr __ph<8> _8{};
/* _LIBCUDACXX_INLINE_VAR */ constexpr __ph<9> _9{};
/* _LIBCUDACXX_INLINE_VAR */ constexpr __ph<10> _10{};
#endif // defined(_LIBCUDACXX_CXX03_LANG) || defined(_LIBCUDACXX_BUILDING_LIBRARY)
#endif // defined(_LIBCUDACXX_BUILDING_LIBRARY)

} // namespace placeholders

Expand All @@ -107,8 +107,6 @@ struct is_placeholder<placeholders::__ph<_Np> >
: public integral_constant<int, _Np> {};


#ifndef _LIBCUDACXX_CXX03_LANG

template <class _Tp, class _Uj>
inline _LIBCUDACXX_INLINE_VISIBILITY
_Tp&
Expand Down Expand Up @@ -409,8 +407,6 @@ bind(_Fp&& __f, _BoundArgs&&... __bound_args)
return type(_CUDA_VSTD::forward<_Fp>(__f), _CUDA_VSTD::forward<_BoundArgs>(__bound_args)...);
}

#endif // _LIBCUDACXX_CXX03_LANG

_LIBCUDACXX_END_NAMESPACE_STD

#endif // __cuda_std__
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@
#pragma GCC system_header
#endif

#ifndef _LIBCUDACXX_CXX03_LANG

_LIBCUDACXX_BEGIN_NAMESPACE_STD

// bad_function_call
Expand Down Expand Up @@ -126,8 +124,6 @@ bool __not_null(_Rp (^__p)(_Args...)) { return __p; }

} // namespace __function

#ifndef _LIBCUDACXX_CXX03_LANG

namespace __function {

// __alloc_func holds a functor and an allocator.
Expand Down Expand Up @@ -1246,16 +1242,9 @@ void
swap(function<_Rp(_ArgTypes...)>& __x, function<_Rp(_ArgTypes...)>& __y) noexcept
{return __x.swap(__y);}

#else // _LIBCUDACXX_CXX03_LANG

#include <__functional_03>

#endif

_LIBCUDACXX_END_NAMESPACE_STD

#endif // _LIBCUDACXX_CXX03_LANG

#endif // __cuda_std__

#endif // _LIBCUDACXX___FUNCTIONAL_FUNCTION_H
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,6 @@ struct _LIBCUDACXX_TEMPLATE_VIS hash<nullptr_t>
};
#endif

#ifndef _LIBCUDACXX_CXX03_LANG
template <class _Key, class _Hash>
using __check_hash_requirements _LIBCUDACXX_NODEBUG_TYPE = integral_constant<bool,
is_copy_constructible<_Hash>::value &&
Expand All @@ -683,8 +682,6 @@ template <class _Type, class ...>
using __enable_hash_helper _LIBCUDACXX_NODEBUG_TYPE = _Type;
#endif

#endif // !_LIBCUDACXX_CXX03_LANG

_LIBCUDACXX_END_NAMESPACE_STD

#endif // __cuda_std__
Expand Down
Loading

0 comments on commit 96bff14

Please sign in to comment.