Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Replace an NV_IF_TARGET dispatch with _LIBCUDACXX_UNREACHABLE
Browse files Browse the repository at this point in the history
  • Loading branch information
wmaxey committed Feb 18, 2022
1 parent fe8f048 commit 8d9bff1
Showing 1 changed file with 8 additions and 40 deletions.
48 changes: 8 additions & 40 deletions include/cuda/std/detail/libcxx/include/stdexcept
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,7 @@ void __throw_logic_error(const char*__msg)
throw logic_error(__msg);
#else
((void)__msg);
NV_IF_ELSE_TARGET(
NV_IS_DEVICE,
__trap();,
_CUDA_VSTD::abort();
)
_LIBCUDACXX_UNREACHABLE
#endif
}

Expand All @@ -246,11 +242,7 @@ void __throw_domain_error(const char*__msg)
throw domain_error(__msg);
#else
((void)__msg);
NV_IF_ELSE_TARGET(
NV_IS_DEVICE,
__trap();,
_CUDA_VSTD::abort();
)
_LIBCUDACXX_UNREACHABLE
#endif
}

Expand All @@ -261,11 +253,7 @@ void __throw_invalid_argument(const char*__msg)
throw invalid_argument(__msg);
#else
((void)__msg);
NV_IF_ELSE_TARGET(
NV_IS_DEVICE,
__trap();,
_CUDA_VSTD::abort();
)
_LIBCUDACXX_UNREACHABLE
#endif
}

Expand All @@ -276,11 +264,7 @@ void __throw_length_error(const char*__msg)
throw length_error(__msg);
#else
((void)__msg);
NV_IF_ELSE_TARGET(
NV_IS_DEVICE,
__trap();,
_CUDA_VSTD::abort();
)
_LIBCUDACXX_UNREACHABLE
#endif
}

Expand All @@ -291,11 +275,7 @@ void __throw_out_of_range(const char*__msg)
throw out_of_range(__msg);
#else
((void)__msg);
NV_IF_ELSE_TARGET(
NV_IS_DEVICE,
__trap();,
_CUDA_VSTD::abort();
)
_LIBCUDACXX_UNREACHABLE
#endif
}

Expand All @@ -306,11 +286,7 @@ void __throw_range_error(const char*__msg)
throw range_error(__msg);
#else
((void)__msg);
NV_IF_ELSE_TARGET(
NV_IS_DEVICE,
__trap();,
_CUDA_VSTD::abort();
)
_LIBCUDACXX_UNREACHABLE
#endif
}

Expand All @@ -321,11 +297,7 @@ void __throw_overflow_error(const char*__msg)
throw overflow_error(__msg);
#else
((void)__msg);
NV_IF_ELSE_TARGET(
NV_IS_DEVICE,
__trap();,
_CUDA_VSTD::abort();
)
_LIBCUDACXX_UNREACHABLE
#endif
}

Expand All @@ -336,11 +308,7 @@ void __throw_underflow_error(const char*__msg)
throw underflow_error(__msg);
#else
((void)__msg);
NV_IF_ELSE_TARGET(
NV_IS_DEVICE,
__trap();,
_CUDA_VSTD::abort();
)
_LIBCUDACXX_UNREACHABLE
#endif
}

Expand Down

0 comments on commit 8d9bff1

Please sign in to comment.