1 #ifndef _COMPADRE_TYPEDEFS_HPP_ 2 #define _COMPADRE_TYPEDEFS_HPP_ 4 #include "Compadre_Config.h" 6 #include <Kokkos_Core.hpp> 7 #include <Kokkos_Random.hpp> 30 #define TO_GLOBAL(variable) ((global_index_type)variable) 40 #ifdef COMPADRE_USE_CUDA 47 typedef typename Kokkos::TeamPolicy<device_execution_space>
team_policy;
58 typedef Kokkos::View<double**, layout_right, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
60 typedef Kokkos::View<double**, layout_left, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
62 typedef Kokkos::View<double*, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
64 typedef Kokkos::View<int*, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
68 typedef Kokkos::View<double**, layout_right, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
70 typedef Kokkos::View<double**, layout_left, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
72 typedef Kokkos::View<double*, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
74 typedef Kokkos::View<int*, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
78 typedef Kokkos::View<double**, layout_right, device_memory_space>
80 typedef Kokkos::View<double**, layout_left, device_memory_space>
82 typedef Kokkos::View<double*, device_memory_space>
84 typedef Kokkos::View<int*, device_memory_space>
88 typedef Kokkos::View<double**, layout_right, host_execution_space>
90 typedef Kokkos::View<double**, layout_left, host_execution_space>
92 typedef Kokkos::View<double*, host_execution_space>
94 typedef Kokkos::View<int*, host_execution_space>
101 template<
bool B,
class T =
void >
105 typename std::enable_if<1==T::rank,T>::type
createView(std::string str,
int dim_0,
int dim_1)
106 {
return T(str, dim_0); }
109 typename std::enable_if<2==T::rank,T>::type
createView(std::string str,
int dim_0,
int dim_1)
110 {
return T(str, dim_0, dim_1); }
118 # define compadre_assert_release(condition) do { \ 119 if ( ! (condition)) { \ 120 std::stringstream _ss_; \ 121 _ss_ << __FILE__ << ":" << __LINE__ << ": FAIL:\n" << #condition \ 123 throw std::logic_error(_ss_.str()); \ 129 # define compadre_kernel_assert_release(condition) do { \ 130 if ( ! (condition)) \ 131 Kokkos::abort(#condition); \ 136 #ifdef COMPADRE_DEBUG 137 # define compadre_assert_debug(condition) do { \ 138 if ( ! (condition)) { \ 139 std::stringstream _ss_; \ 140 _ss_ << __FILE__ << ":" << __LINE__ << ": FAIL:\n" << #condition \ 142 throw std::logic_error(_ss_.str()); \ 145 # define compadre_kernel_assert_debug(condition) do { \ 146 if ( ! (condition)) \ 147 Kokkos::abort(#condition); \ 150 # define compadre_assert_debug(condition) 151 # define compadre_kernel_assert_debug(condition) 156 #ifdef COMPADRE_EXTREME_DEBUG 157 # define compadre_assert_extreme_debug(condition) do { \ 158 if ( ! (condition)) { \ 159 std::stringstream _ss_; \ 160 _ss_ << __FILE__ << ":" << __LINE__ << ": FAIL:\n" << #condition \ 162 throw std::logic_error(_ss_.str()); \ 165 # define compadre_kernel_assert_extreme_debug(condition) do { \ 166 if ( ! (condition)) \ 167 Kokkos::abort(#condition); \ 170 # define compadre_assert_extreme_debug(condition) 171 # define compadre_kernel_assert_extreme_debug(condition) Kokkos::View< double **, layout_left, host_execution_space > host_managed_matrix_left_type
std::size_t global_index_type
pool_type::generator_type generator_type
Kokkos::View< double *, device_memory_space > device_managed_vector_type
team_policy::member_type member_type
Kokkos::View< double **, layout_right, host_execution_space > host_managed_matrix_right_type
Kokkos::View< int *, device_memory_space > device_managed_local_index_type
Kokkos::DefaultHostExecutionSpace host_execution_space
Kokkos::TeamPolicy< host_execution_space > host_team_policy
Kokkos::TeamPolicy< device_execution_space > team_policy
Kokkos::View< int *, host_execution_space > host_managed_local_index_type
Kokkos::DefaultExecutionSpace device_execution_space
Kokkos::View< double **, layout_right, host_execution_space, Kokkos::MemoryTraits< Kokkos::Unmanaged > > host_scratch_matrix_right_type
device_execution_space::memory_space device_memory_space
Kokkos::View< double *, host_execution_space > host_managed_vector_type
typename std::enable_if< B, T >::type enable_if_t
Kokkos::View< double **, layout_right, device_memory_space > device_managed_matrix_right_type
Kokkos::View< double **, layout_right, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_matrix_right_type
Kokkos::View< double *, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_vector_type
Kokkos::View< double **, layout_left, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_matrix_left_type
Kokkos::View< double **, layout_left, device_memory_space > device_managed_matrix_left_type
Kokkos::View< double **, layout_left, host_execution_space, Kokkos::MemoryTraits< Kokkos::Unmanaged > > host_scratch_matrix_left_type
Kokkos::LayoutLeft layout_left
Kokkos::View< int *, host_execution_space, Kokkos::MemoryTraits< Kokkos::Unmanaged > > host_scratch_local_index_type
host_execution_space::memory_space host_memory_space
Kokkos::Random_XorShift64_Pool pool_type
host_team_policy::member_type host_member_type
Kokkos::LayoutRight layout_right
std::enable_if< 1==T::rank, T >::type createView(std::string str, int dim_0, int dim_1)
Kokkos::View< double *, host_execution_space, Kokkos::MemoryTraits< Kokkos::Unmanaged > > host_scratch_vector_type
Kokkos::View< int *, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_local_index_type