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>
39#define TO_GLOBAL(variable) ((global_index_type)variable)
51#ifdef COMPADRE_USE_CUDA
58typedef typename Kokkos::TeamPolicy<device_execution_space>
team_policy;
69typedef Kokkos::View<double**, layout_right, device_scratch, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
71typedef Kokkos::View<double**, layout_left, device_scratch, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
73typedef Kokkos::View<double*, device_scratch, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
75typedef Kokkos::View<int*, device_scratch, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
79typedef Kokkos::View<double**, layout_right, host_scratch, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
81typedef Kokkos::View<double**, layout_left, host_scratch, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
83typedef Kokkos::View<double*, host_scratch, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
85typedef Kokkos::View<int*, host_scratch, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
89typedef Kokkos::View<double**, layout_right, device_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
91typedef Kokkos::View<double**, layout_left, device_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
93typedef Kokkos::View<double*, device_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
95typedef Kokkos::View<int*, device_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
99typedef Kokkos::View<double**, layout_right, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
101typedef Kokkos::View<double**, layout_left, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
103typedef Kokkos::View<double*, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
105typedef Kokkos::View<int*, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
109typedef Kokkos::View<double**, layout_right, device_memory_space>
111typedef Kokkos::View<double**, layout_left, device_memory_space>
113typedef Kokkos::View<double*, device_memory_space>
115typedef Kokkos::View<int*, device_memory_space>
119typedef Kokkos::View<double**, layout_right, host_execution_space>
121typedef Kokkos::View<double**, layout_left, host_execution_space>
123typedef Kokkos::View<double*, host_execution_space>
125typedef Kokkos::View<int*, host_execution_space>
135template<
bool B,
class T =
void >
139typename std::enable_if<1==T::rank,T>::type
createView(std::string str,
int dim_0,
int dim_1)
140{
return T(str, dim_0); }
143typename std::enable_if<2==T::rank,T>::type
createView(std::string str,
int dim_0,
int dim_1)
144{
return T(str, dim_0, dim_1); }
152# define compadre_assert_release(condition) do { \
153 if ( ! (condition)) { \
154 std::stringstream _ss_; \
155 _ss_ << __FILE__ << ":" << __LINE__ << ": FAIL:\n" << #condition \
157 throw std::logic_error(_ss_.str()); \
163# define compadre_kernel_assert_release(condition) do { \
164 if ( ! (condition)) \
165 Kokkos::abort(#condition); \
171# define compadre_assert_debug(condition) do { \
172 if ( ! (condition)) { \
173 std::stringstream _ss_; \
174 _ss_ << __FILE__ << ":" << __LINE__ << ": FAIL:\n" << #condition \
176 throw std::logic_error(_ss_.str()); \
179# define compadre_kernel_assert_debug(condition) do { \
180 if ( ! (condition)) \
181 Kokkos::abort(#condition); \
184# define compadre_assert_debug(condition)
185# define compadre_kernel_assert_debug(condition)
190#ifdef COMPADRE_EXTREME_DEBUG
191# define compadre_assert_extreme_debug(condition) do { \
192 if ( ! (condition)) { \
193 std::stringstream _ss_; \
194 _ss_ << __FILE__ << ":" << __LINE__ << ": FAIL:\n" << #condition \
196 throw std::logic_error(_ss_.str()); \
199# define compadre_kernel_assert_extreme_debug(condition) do { \
200 if ( ! (condition)) \
201 Kokkos::abort(#condition); \
204# define compadre_assert_extreme_debug(condition)
205# define compadre_kernel_assert_extreme_debug(condition)
Kokkos::Random_XorShift64_Pool pool_type
Kokkos::View< int *, device_memory_space > device_managed_local_index_type
std::enable_if< 1==T::rank, T >::type createView(std::string str, int dim_0, int dim_1)
Kokkos::View< int *, host_scratch, Kokkos::MemoryTraits< Kokkos::Unmanaged > > host_scratch_local_index_type
Kokkos::View< double *, host_execution_space > host_managed_vector_type
Kokkos::View< double **, layout_right, host_execution_space > host_managed_matrix_right_type
Kokkos::View< int *, host_execution_space, Kokkos::MemoryTraits< Kokkos::Unmanaged > > host_unmanaged_local_index_type
Kokkos::View< double **, layout_right, device_memory_space > device_managed_matrix_right_type
Kokkos::View< double *, device_memory_space > device_managed_vector_type
team_policy::member_type member_type
Kokkos::View< double *, device_scratch, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_vector_type
Kokkos::TeamPolicy< host_execution_space > host_team_policy
pool_type::generator_type generator_type
Kokkos::View< double **, layout_right, host_execution_space, Kokkos::MemoryTraits< Kokkos::Unmanaged > > host_unmanaged_matrix_right_type
Kokkos::TeamPolicy< device_execution_space > team_policy
Kokkos::View< double **, layout_left, host_execution_space, Kokkos::MemoryTraits< Kokkos::Unmanaged > > host_unmanaged_matrix_left_type
Kokkos::LayoutRight layout_right
Kokkos::View< int *, host_execution_space > host_managed_local_index_type
Kokkos::View< double **, layout_right, device_scratch, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_matrix_right_type
Kokkos::View< double **, layout_left, device_scratch, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_matrix_left_type
Kokkos::View< int *, device_scratch, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_local_index_type
typename std::enable_if< B, T >::type enable_if_t
Kokkos::View< double **, layout_left, host_scratch, Kokkos::MemoryTraits< Kokkos::Unmanaged > > host_scratch_matrix_left_type
Kokkos::View< double *, host_execution_space, Kokkos::MemoryTraits< Kokkos::Unmanaged > > host_unmanaged_vector_type
host_team_policy::member_type host_member_type
Kokkos::View< double **, layout_left, host_execution_space > host_managed_matrix_left_type
constexpr char KOKKOS_THREADS_ARG[]
Kokkos::DefaultHostExecutionSpace host_execution_space
Kokkos::InitializationSettings KokkosInitArguments
host_execution_space::memory_space host_memory_space
std::size_t global_index_type
Kokkos::View< double **, layout_right, host_scratch, Kokkos::MemoryTraits< Kokkos::Unmanaged > > host_scratch_matrix_right_type
Kokkos::View< double **, layout_right, device_execution_space, Kokkos::MemoryTraits< Kokkos::Unmanaged > > device_unmanaged_matrix_right_type
Kokkos::View< int *, device_execution_space, Kokkos::MemoryTraits< Kokkos::Unmanaged > > device_unmanaged_local_index_type
Kokkos::View< double **, layout_left, device_execution_space, Kokkos::MemoryTraits< Kokkos::Unmanaged > > device_unmanaged_matrix_left_type
host_execution_space::scratch_memory_space host_scratch
device_execution_space::memory_space device_memory_space
device_execution_space::scratch_memory_space device_scratch
Kokkos::DefaultExecutionSpace device_execution_space
Kokkos::View< double **, layout_left, device_memory_space > device_managed_matrix_left_type
Kokkos::LayoutLeft layout_left
Kokkos::View< double *, device_execution_space, Kokkos::MemoryTraits< Kokkos::Unmanaged > > device_unmanaged_vector_type
Kokkos::View< double *, host_scratch, Kokkos::MemoryTraits< Kokkos::Unmanaged > > host_scratch_vector_type