Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to use the same redefinition of __assert_fail as pytorch has #2577

Merged
merged 3 commits into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions libcudacxx/include/cuda/std/__cccl/assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include <cuda/std/__cccl/attributes.h>
#include <cuda/std/__cccl/builtin.h>
#include <cuda/std/__cccl/execution_space.h>

#if !defined(_CCCL_COMPILER_NVRTC)
# include <assert.h>
Expand Down Expand Up @@ -68,9 +69,14 @@
#else // ^^^ MSVC STL ^^^ / vvv !MSVC STL vvv
# ifdef NDEBUG
// Reintroduce the __assert_fail declaration
extern void
__assert_fail(const char* __assertion, const char* __file, unsigned int __line, const char* __function) __THROW
extern "C" {
# if !defined(_CCCL_CUDA_COMPILER_CLANG)
_CCCL_HOST_DEVICE
# endif // !_CCCL_CUDA_COMPILER_CLANG
void
__assert_fail(const char* __assertion, const char* __file, unsigned int __line, const char* __function) noexcept
__attribute__((__noreturn__));
}
# endif // NDEBUG
// ICC cannot deal with `__builtin_expect` in the constexpr evaluator, so just drop it
# if defined(_CCCL_COMPILER_ICC)
Expand Down
Loading