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

Use Kokkos::abort() in DEAL_II_NOT_IMPLEMENTED(). #16553

Open
bangerth opened this issue Jan 26, 2024 · 0 comments · May be fixed by #17018
Open

Use Kokkos::abort() in DEAL_II_NOT_IMPLEMENTED(). #16553

bangerth opened this issue Jan 26, 2024 · 0 comments · May be fixed by #17018
Milestone

Comments

@bangerth
Copy link
Member

This is a necessary follow-up to #16543: As mentioned in #16543 (comment), we can't use std::abort() on devices. Instead, we must use Kokkos::abort("text");.

For reference, Assert is currently defined in the following way:

#  if KOKKOS_VERSION >= 30600
#    ifdef DEAL_II_HAVE_BUILTIN_EXPECT
#      define Assert(cond, exc)                                                \
        do                                                                     \
          {                                                                    \
            KOKKOS_IF_ON_HOST(({                                               \
              if (__builtin_expect(!(cond), false))                            \
                ::dealii::deal_II_exceptions::internals::issue_error_noreturn( \
                  ::dealii::deal_II_exceptions::internals::ExceptionHandling:: \
                    abort_or_throw_on_exception,                               \
                  __FILE__,                                                    \
                  __LINE__,                                                    \
                  __PRETTY_FUNCTION__,                                         \
                  #cond,                                                       \
                  #exc,                                                        \
                  exc);                                                        \
            }))                                                                \
            KOKKOS_IF_ON_DEVICE(({                                             \
              if (!(cond))                                                     \
                Kokkos::abort(#cond);                                          \
            }))                                                                \
          }                                                                    \
        while (false)
@bangerth bangerth added this to the Release 9.6 milestone Mar 8, 2024
@bangerth bangerth linked a pull request May 14, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant