Skip to content

Commit

Permalink
Try and fix including the exception header
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco committed Jan 17, 2024
1 parent 92d348f commit 27e89be
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
#include <__config>
#endif // __cuda_std__

#include "../__utility/move.h"
#include "../exception"

#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
# pragma GCC system_header
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
Expand All @@ -24,6 +21,9 @@
# pragma system_header
#endif // no system header

#include "../__utility/move.h"
#include "../exception"

#if _CCCL_STD_VER > 2011

_LIBCUDACXX_BEGIN_NAMESPACE_STD
Expand Down
27 changes: 14 additions & 13 deletions libcudacxx/include/cuda/std/detail/libcxx/include/exception
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,6 @@ template <class E> void rethrow_if_nested(const E& e);
#include <__config>
#endif //__cuda_std__

#include "cstddef"
#include "cstdlib"
#include "type_traits"
#include "version"

#if defined(_LIBCUDACXX_ABI_VCRUNTIME)
#include <vcruntime_exception.h>
#endif

#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
# pragma GCC system_header
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
Expand All @@ -97,6 +88,14 @@ template <class E> void rethrow_if_nested(const E& e);
# pragma system_header
#endif // no system header

#include "cstddef"
#include "cstdlib"
#include "type_traits"
#include "version"

#if defined(_LIBCUDACXX_ABI_VCRUNTIME)
#include <vcruntime_exception.h>
#endif
_LIBCUDACXX_BEGIN_NAMESPACE_STD_NOVERSION // purposefully not using versioning namespace

#if !defined(_LIBCUDACXX_ABI_VCRUNTIME) || defined(__cuda_std__)
Expand All @@ -116,11 +115,9 @@ public:
_LIBCUDACXX_HOST_DEVICE virtual ~bad_exception() noexcept;
_LIBCUDACXX_HOST_DEVICE virtual const char* what() const noexcept;
};
#else // ^^^ !_LIBCUDACXX_ABI_VCRUNTIME || __cuda_std__ ^^^ / vvv _LIBCUDACXX_ABI_VCRUNTIME vvv
#else // ^^^ !_LIBCUDACXX_ABI_VCRUNTIME || __cuda_std__^^^ / vvv _LIBCUDACXX_ABI_VCRUNTIME vvv
// pull in the exception definition from vcruntime, which lives in namespace std
#if defined(_LIBCUDACXX_COMPILER_MSVC)
using ::std::exception;
#endif // _LIBCUDACXX_COMPILER_MSVC
#endif // !_LIBCUDACXX_ABI_VCRUNTIME

#if _CCCL_STD_VER <= 2014 \
Expand Down Expand Up @@ -308,9 +305,13 @@ throw_with_nested(_Tp&& __t)

template <class _From, class _To>
struct __can_dynamic_cast : public _LIBCUDACXX_BOOL_CONSTANT(
#ifdef _LIBCUDACXX_NO_EXCEPTIONS
false &&
#endif // _LIBCUDACXX_NO_EXCEPTIONS
is_polymorphic<_From>::value &&
(!is_base_of<_To, _From>::value ||
is_convertible<const _From*, const _To*>::value)) {};
is_convertible<const _From*, const _To*>::value))
{};

template <class _Ep>
inline _LIBCUDACXX_INLINE_VISIBILITY
Expand Down

0 comments on commit 27e89be

Please sign in to comment.