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)
49#ifdef COMPADRE_USE_CUDA
56typedef typename Kokkos::TeamPolicy<device_execution_space>
team_policy;
67typedef Kokkos::View<double**, layout_right, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
69typedef Kokkos::View<double**, layout_left, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
71typedef Kokkos::View<double*, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
73typedef Kokkos::View<int*, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
77typedef Kokkos::View<double**, layout_right, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
79typedef Kokkos::View<double**, layout_left, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
81typedef Kokkos::View<double*, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
83typedef Kokkos::View<int*, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
87typedef Kokkos::View<double**, layout_right, device_memory_space>
89typedef Kokkos::View<double**, layout_left, device_memory_space>
91typedef Kokkos::View<double*, device_memory_space>
93typedef Kokkos::View<int*, device_memory_space>
97typedef Kokkos::View<double**, layout_right, host_execution_space>
99typedef Kokkos::View<double**, layout_left, host_execution_space>
101typedef Kokkos::View<double*, host_execution_space>
103typedef Kokkos::View<int*, host_execution_space>
113template<
bool B,
class T =
void >
117typename std::enable_if<1==T::rank,T>::type
createView(std::string str,
int dim_0,
int dim_1)
118{
return T(str, dim_0); }
121typename std::enable_if<2==T::rank,T>::type
createView(std::string str,
int dim_0,
int dim_1)
122{
return T(str, dim_0, dim_1); }
130# define compadre_assert_release(condition) do { \
131 if ( ! (condition)) { \
132 std::stringstream _ss_; \
133 _ss_ << __FILE__ << ":" << __LINE__ << ": FAIL:\n" << #condition \
135 throw std::logic_error(_ss_.str()); \
141# define compadre_kernel_assert_release(condition) do { \
142 if ( ! (condition)) \
143 Kokkos::abort(#condition); \
149# define compadre_assert_debug(condition) do { \
150 if ( ! (condition)) { \
151 std::stringstream _ss_; \
152 _ss_ << __FILE__ << ":" << __LINE__ << ": FAIL:\n" << #condition \
154 throw std::logic_error(_ss_.str()); \
157# define compadre_kernel_assert_debug(condition) do { \
158 if ( ! (condition)) \
159 Kokkos::abort(#condition); \
162# define compadre_assert_debug(condition)
163# define compadre_kernel_assert_debug(condition)
168#ifdef COMPADRE_EXTREME_DEBUG
169# define compadre_assert_extreme_debug(condition) do { \
170 if ( ! (condition)) { \
171 std::stringstream _ss_; \
172 _ss_ << __FILE__ << ":" << __LINE__ << ": FAIL:\n" << #condition \
174 throw std::logic_error(_ss_.str()); \
177# define compadre_kernel_assert_extreme_debug(condition) do { \
178 if ( ! (condition)) \
179 Kokkos::abort(#condition); \
182# define compadre_assert_extreme_debug(condition)
183# 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< double *, host_execution_space > host_managed_vector_type
Kokkos::View< double **, layout_right, host_execution_space > host_managed_matrix_right_type
Kokkos::View< double *, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_vector_type
Kokkos::View< double **, layout_left, host_execution_space, Kokkos::MemoryTraits< Kokkos::Unmanaged > > host_scratch_matrix_left_type
Kokkos::View< double **, layout_right, device_memory_space > device_managed_matrix_right_type
Kokkos::View< int *, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_local_index_type
Kokkos::View< double **, layout_right, host_execution_space, Kokkos::MemoryTraits< Kokkos::Unmanaged > > host_scratch_matrix_right_type
Kokkos::View< double **, layout_left, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_matrix_left_type
Kokkos::View< double *, device_memory_space > device_managed_vector_type
team_policy::member_type member_type
Kokkos::TeamPolicy< host_execution_space > host_team_policy
pool_type::generator_type generator_type
Kokkos::TeamPolicy< device_execution_space > team_policy
Kokkos::LayoutRight layout_right
Kokkos::View< int *, host_execution_space > host_managed_local_index_type
typename std::enable_if< B, T >::type enable_if_t
Kokkos::View< double *, host_execution_space, Kokkos::MemoryTraits< Kokkos::Unmanaged > > host_scratch_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
device_execution_space::memory_space device_memory_space
Kokkos::View< int *, host_execution_space, Kokkos::MemoryTraits< Kokkos::Unmanaged > > host_scratch_local_index_type
Kokkos::DefaultExecutionSpace device_execution_space
Kokkos::View< double **, layout_right, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_matrix_right_type
Kokkos::View< double **, layout_left, device_memory_space > device_managed_matrix_left_type
Kokkos::LayoutLeft layout_left