9 #ifndef _COMPADRE_TYPEDEFS_HPP_
10 #define _COMPADRE_TYPEDEFS_HPP_
12 #include "Compadre_Config.h"
14 #include <Kokkos_Core.hpp>
15 #include <Kokkos_Random.hpp>
16 #include <type_traits>
38 #define TO_GLOBAL(variable) ((global_index_type)variable)
48 #ifdef COMPADRE_USE_CUDA
55 typedef typename Kokkos::TeamPolicy<device_execution_space>
team_policy;
66 typedef Kokkos::View<double**, layout_right, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
68 typedef Kokkos::View<double**, layout_left, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
70 typedef Kokkos::View<double*, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
72 typedef Kokkos::View<int*, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
76 typedef Kokkos::View<double**, layout_right, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
78 typedef Kokkos::View<double**, layout_left, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
80 typedef Kokkos::View<double*, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
82 typedef Kokkos::View<int*, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
86 typedef Kokkos::View<double**, layout_right, device_memory_space>
88 typedef Kokkos::View<double**, layout_left, device_memory_space>
90 typedef Kokkos::View<double*, device_memory_space>
92 typedef Kokkos::View<int*, device_memory_space>
96 typedef Kokkos::View<double**, layout_right, host_execution_space>
98 typedef Kokkos::View<double**, layout_left, host_execution_space>
100 typedef Kokkos::View<double*, host_execution_space>
102 typedef Kokkos::View<int*, host_execution_space>
112 template<
bool B,
class T =
void >
116 typename std::enable_if<1==T::rank,T>::type
createView(std::string str,
int dim_0,
int dim_1)
117 {
return T(str, dim_0); }
120 typename std::enable_if<2==T::rank,T>::type
createView(std::string str,
int dim_0,
int dim_1)
121 {
return T(str, dim_0, dim_1); }
129 # define compadre_assert_release(condition) do { \
130 if ( ! (condition)) { \
131 std::stringstream _ss_; \
132 _ss_ << __FILE__ << ":" << __LINE__ << ": FAIL:\n" << #condition \
134 throw std::logic_error(_ss_.str()); \
140 # define compadre_kernel_assert_release(condition) do { \
141 if ( ! (condition)) \
142 Kokkos::abort(#condition); \
147 #ifdef COMPADRE_DEBUG
148 # define compadre_assert_debug(condition) do { \
149 if ( ! (condition)) { \
150 std::stringstream _ss_; \
151 _ss_ << __FILE__ << ":" << __LINE__ << ": FAIL:\n" << #condition \
153 throw std::logic_error(_ss_.str()); \
156 # define compadre_kernel_assert_debug(condition) do { \
157 if ( ! (condition)) \
158 Kokkos::abort(#condition); \
161 # define compadre_assert_debug(condition)
162 # define compadre_kernel_assert_debug(condition)
167 #ifdef COMPADRE_EXTREME_DEBUG
168 # define compadre_assert_extreme_debug(condition) do { \
169 if ( ! (condition)) { \
170 std::stringstream _ss_; \
171 _ss_ << __FILE__ << ":" << __LINE__ << ": FAIL:\n" << #condition \
173 throw std::logic_error(_ss_.str()); \
176 # define compadre_kernel_assert_extreme_debug(condition) do { \
177 if ( ! (condition)) \
178 Kokkos::abort(#condition); \
181 # define compadre_assert_extreme_debug(condition)
182 # define compadre_kernel_assert_extreme_debug(condition)
Kokkos::DefaultExecutionSpace device_execution_space
Kokkos::TeamPolicy< host_execution_space > host_team_policy
Kokkos::View< double **, layout_left, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_matrix_left_type
Kokkos::View< double **, layout_left, host_execution_space, Kokkos::MemoryTraits< Kokkos::Unmanaged > > host_scratch_matrix_left_type
Kokkos::View< double **, layout_right, host_execution_space > host_managed_matrix_right_type
Kokkos::View< double *, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_vector_type
host_execution_space::memory_space host_memory_space
Kokkos::DefaultHostExecutionSpace host_execution_space
Kokkos::Random_XorShift64_Pool pool_type
std::size_t global_index_type
Kokkos::View< double *, host_execution_space > host_managed_vector_type
Kokkos::View< int *, host_execution_space, Kokkos::MemoryTraits< Kokkos::Unmanaged > > host_scratch_local_index_type
Kokkos::LayoutLeft layout_left
Kokkos::TeamPolicy< device_execution_space > team_policy
constexpr char KOKKOS_THREADS_ARG[]
std::enable_if< 1==T::rank, T >::type createView(std::string str, int dim_0, int dim_1)
typename std::enable_if< B, T >::type enable_if_t
Kokkos::View< int *, device_memory_space > device_managed_local_index_type
Kokkos::View< double *, device_memory_space > device_managed_vector_type
Kokkos::View< double **, layout_right, device_memory_space > device_managed_matrix_right_type
Kokkos::View< int *, host_execution_space > host_managed_local_index_type
Kokkos::InitializationSettings KokkosInitArguments
Kokkos::View< double **, layout_left, device_memory_space > device_managed_matrix_left_type
Kokkos::View< double **, layout_left, host_execution_space > host_managed_matrix_left_type
team_policy::member_type member_type
host_team_policy::member_type host_member_type
Kokkos::LayoutRight layout_right
Kokkos::View< double *, host_execution_space, Kokkos::MemoryTraits< Kokkos::Unmanaged > > host_scratch_vector_type
pool_type::generator_type generator_type
device_execution_space::memory_space device_memory_space
Kokkos::View< int *, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_local_index_type
Kokkos::View< double **, layout_right, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_matrix_right_type
Kokkos::View< double **, layout_right, host_execution_space, Kokkos::MemoryTraits< Kokkos::Unmanaged > > host_scratch_matrix_right_type