Loading...
Searching...
No Matches
Go to the documentation of this file.
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 "libmesh/restore_warnings.h"
33# define LIBMESH_DEVICE_INLINE KOKKOS_INLINE_FUNCTION
38# if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__) || defined(__SYCL_DEVICE_ONLY__)
39# define LIBMESH_IN_DEVICE_CODE 1
41# define LIBMESH_IN_DEVICE_CODE 0
49# define LIBMESH_DEVICE_ASSERT(asserted) \
50 do { if (!(asserted)) { \
51 printf("libMesh assert failed: %s, file %s, line %d\n", \
52 #asserted, __FILE__, __LINE__); \
53 ::Kokkos::abort("libmesh_assert failed"); \
56# define LIBMESH_DEVICE_ASSERT(asserted) ((void) 0)
59# define LIBMESH_DEVICE_ERROR_MSG(msg) \
61 printf("libMesh error: %s, file %s, line %d\n", \
62 msg, __FILE__, __LINE__); \
63 ::Kokkos::abort(msg); \
66# define LIBMESH_DEVICE_ERROR_MSG_IF(cond, msg) \
67 do { if (cond) { LIBMESH_DEVICE_ERROR_MSG(msg); } } while (0)
70# define LIBMESH_DEVICE_INLINE inline
71# define LIBMESH_IN_DEVICE_CODE 0