Skip to content

Commit

Permalink
Drop _LIBCUDACXX_HAS_NO_STRONG_ENUMS
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco committed Apr 30, 2024
1 parent eef0eb2 commit f941720
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 37 deletions.
29 changes: 2 additions & 27 deletions libcudacxx/include/cuda/std/detail/libcxx/include/__config
Original file line number Diff line number Diff line change
Expand Up @@ -776,10 +776,6 @@ typedef __char16_t char16_t;
typedef __char32_t char32_t;
# endif

# if !(__has_feature(cxx_strong_enums))
# define _LIBCUDACXX_HAS_NO_STRONG_ENUMS
# endif

# if !(__has_feature(cxx_lambdas))
# define _LIBCUDACXX_HAS_NO_LAMBDAS
# endif
Expand Down Expand Up @@ -1326,29 +1322,8 @@ typedef unsigned int char32_t;
# define _LIBCUDACXX_HAS_NO_BUILTIN_OPERATOR_NEW_DELETE
# endif

# ifdef _LIBCUDACXX_HAS_NO_STRONG_ENUMS
# define _LIBCUDACXX_DECLARE_STRONG_ENUM(x) \
struct _LIBCUDACXX_TYPE_VIS x \
{ \
enum __lx
# define _LIBCUDACXX_DECLARE_STRONG_ENUM_EPILOG(x) \
__lx __v_; \
_LIBCUDACXX_INLINE_VISIBILITY x(__lx __v) \
: __v_(__v) \
{} \
_LIBCUDACXX_INLINE_VISIBILITY explicit x(int __v) \
: __v_(static_cast<__lx>(__v)) \
{} \
_LIBCUDACXX_INLINE_VISIBILITY operator int() const \
{ \
return __v_; \
} \
} \
;
# else // _LIBCUDACXX_HAS_NO_STRONG_ENUMS
# define _LIBCUDACXX_DECLARE_STRONG_ENUM(x) enum class _LIBCUDACXX_ENUM_VIS x
# define _LIBCUDACXX_DECLARE_STRONG_ENUM_EPILOG(x)
# endif // _LIBCUDACXX_HAS_NO_STRONG_ENUMS
# define _LIBCUDACXX_DECLARE_STRONG_ENUM(x) enum class _LIBCUDACXX_ENUM_VIS x
# define _LIBCUDACXX_DECLARE_STRONG_ENUM_EPILOG(x)

# ifdef _LIBCUDACXX_DEBUG
# if _LIBCUDACXX_DEBUG == 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ enum BigEnum : unsigned long long // MSVC's ABI doesn't follow the Standard
big = 0xFFFFFFFFFFFFFFFFULL
};

#if !defined(_LIBCUDACXX_HAS_NO_INT128) && !defined(_LIBCUDACXX_HAS_NO_STRONG_ENUMS)
#if !defined(_LIBCUDACXX_HAS_NO_INT128)
enum HugeEnum : __uint128_t
{
hugezero
};
#endif
#endif // !_LIBCUDACXX_HAS_NO_INT128

template <class T, class U>
__host__ __device__ void test_make_signed()
Expand Down Expand Up @@ -62,10 +62,8 @@ int main(int, char**)
#ifndef _LIBCUDACXX_HAS_NO_INT128
test_make_signed<__int128_t, __int128_t>();
test_make_signed<__uint128_t, __int128_t>();
# ifndef _LIBCUDACXX_HAS_NO_STRONG_ENUMS
test_make_signed<HugeEnum, __int128_t>();
# endif
#endif
#endif // !_LIBCUDACXX_HAS_NO_INT128

return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ enum BigEnum : unsigned long long // MSVC's ABI doesn't follow the Standard
big = 0xFFFFFFFFFFFFFFFFULL
};

#if !defined(_LIBCUDACXX_HAS_NO_INT128) && !defined(_LIBCUDACXX_HAS_NO_STRONG_ENUMS)
#if !defined(_LIBCUDACXX_HAS_NO_INT128)
enum HugeEnum : __int128_t
{
hugezero
};
#endif
#endif // !_LIBCUDACXX_HAS_NO_INT128

template <class T, class U>
__host__ __device__ void test_make_unsigned()
Expand Down Expand Up @@ -65,10 +65,8 @@ int main(int, char**)
#ifndef _LIBCUDACXX_HAS_NO_INT128
test_make_unsigned<__int128_t, __uint128_t>();
test_make_unsigned<__uint128_t, __uint128_t>();
# ifndef _LIBCUDACXX_HAS_NO_STRONG_ENUMS
test_make_unsigned<HugeEnum, __uint128_t>();
# endif
#endif
#endif // _LIBCUDACXX_HAS_NO_INT128

return 0;
}

0 comments on commit f941720

Please sign in to comment.