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
47typedef typename Kokkos::TeamPolicy<device_execution_space>
team_policy;
58typedef Kokkos::View<double**, layout_right, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
60typedef Kokkos::View<double**, layout_left, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
62typedef Kokkos::View<double*, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
64typedef Kokkos::View<int*, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
68typedef Kokkos::View<double**, layout_right, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
70typedef Kokkos::View<double**, layout_left, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
72typedef Kokkos::View<double*, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
74typedef Kokkos::View<int*, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
78typedef Kokkos::View<double**, layout_right, device_memory_space>
80typedef Kokkos::View<double**, layout_left, device_memory_space>
82typedef Kokkos::View<double*, device_memory_space>
84typedef Kokkos::View<int*, device_memory_space>
88typedef Kokkos::View<double**, layout_right, host_execution_space>
90typedef Kokkos::View<double**, layout_left, host_execution_space>
92typedef Kokkos::View<double*, host_execution_space>
94typedef Kokkos::View<int*, host_execution_space>
105 #define COMPADRE_KOKKOS_VERSION_MAJOR KOKKOS_VERSION / 10000
106 #define COMPADRE_KOKKOS_VERSION_MINOR KOKKOS_VERSION / 100 % 100
107 #if COMPADRE_KOKKOS_VERSION_MAJOR < 4
108 #if COMPADRE_KOKKOS_VERSION_MINOR >= 7
110 #define COMPADRE_KOKKOS_GREATEREQUAL_3_7
112 #elif COMPADRE_KOKKOS_VERSION_MINOR < 7
116 #elif COMPADRE_KOKKOS_VERSION_MAJOR >= 4
118 #define COMPADRE_KOKKOS_GREATEREQUAL_3_7
126template<
bool B,
class T =
void >
130typename std::enable_if<1==T::rank,T>::type
createView(std::string str,
int dim_0,
int dim_1)
131{
return T(str, dim_0); }
134typename std::enable_if<2==T::rank,T>::type
createView(std::string str,
int dim_0,
int dim_1)
135{
return T(str, dim_0, dim_1); }
143# define compadre_assert_release(condition) do { \
144 if ( ! (condition)) { \
145 std::stringstream _ss_; \
146 _ss_ << __FILE__ << ":" << __LINE__ << ": FAIL:\n" << #condition \
148 throw std::logic_error(_ss_.str()); \
154# define compadre_kernel_assert_release(condition) do { \
155 if ( ! (condition)) \
156 Kokkos::abort(#condition); \
162# define compadre_assert_debug(condition) do { \
163 if ( ! (condition)) { \
164 std::stringstream _ss_; \
165 _ss_ << __FILE__ << ":" << __LINE__ << ": FAIL:\n" << #condition \
167 throw std::logic_error(_ss_.str()); \
170# define compadre_kernel_assert_debug(condition) do { \
171 if ( ! (condition)) \
172 Kokkos::abort(#condition); \
175# define compadre_assert_debug(condition)
176# define compadre_kernel_assert_debug(condition)
181#ifdef COMPADRE_EXTREME_DEBUG
182# define compadre_assert_extreme_debug(condition) do { \
183 if ( ! (condition)) { \
184 std::stringstream _ss_; \
185 _ss_ << __FILE__ << ":" << __LINE__ << ": FAIL:\n" << #condition \
187 throw std::logic_error(_ss_.str()); \
190# define compadre_kernel_assert_extreme_debug(condition) do { \
191 if ( ! (condition)) \
192 Kokkos::abort(#condition); \
195# define compadre_assert_extreme_debug(condition)
196# 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
std::enable_if< 1==T::rank, T >::type createView(std::string str, int dim_0, int dim_1)
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[]
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::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
Kokkos::InitArguments KokkosInitArguments
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