18#ifndef LIBMESH_LIBMESH_DEVICE_H
19#define LIBMESH_LIBMESH_DEVICE_H
28#ifdef ACSM_KOKKOS_COMPILATION
29# include "libmesh/ignore_warnings.h"
30# include <Kokkos_Macros.hpp>
31# include <Kokkos_Abort.hpp>
32# include <Kokkos_MathematicalFunctions.hpp>
33# include "libmesh/restore_warnings.h"
34# define LIBMESH_DEVICE_INLINE KOKKOS_INLINE_FUNCTION
39# if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__) || defined(__SYCL_DEVICE_ONLY__)
40# define LIBMESH_IN_DEVICE_CODE 1
42# define LIBMESH_IN_DEVICE_CODE 0
47# define LIBMESH_STRINGIFY_IMPL(x) #x
48# define LIBMESH_STRINGIFY(x) LIBMESH_STRINGIFY_IMPL(x)
57# define LIBMESH_DEVICE_ASSERT(asserted) \
58 do { if (!(asserted)) { \
59 ::Kokkos::abort("libMesh assert failed: " #asserted \
61 ", line " LIBMESH_STRINGIFY(__LINE__)); \
64# define LIBMESH_DEVICE_ASSERT(asserted) ((void) 0)
71# define LIBMESH_DEVICE_ERROR_MSG(msg) \
72 ::Kokkos::abort("libMesh error: " #msg \
74 ", line " LIBMESH_STRINGIFY(__LINE__))
76# define LIBMESH_DEVICE_ERROR_MSG_IF(cond, msg) \
77 do { if (cond) { LIBMESH_DEVICE_ERROR_MSG(msg); } } while (0)
80# define LIBMESH_DEVICE_INLINE inline
81# define LIBMESH_IN_DEVICE_CODE 0
94#ifdef ACSM_KOKKOS_COMPILATION
95namespace portable_math = ::Kokkos;
97namespace portable_math =
std;
The libMesh namespace provides an interface to certain functionality in the library.