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#if defined(COMPADRE_USE_CUDA)
53#elif defined(COMPADRE_USE_HIP)
60typedef typename Kokkos::TeamPolicy<device_execution_space>
team_policy;
71typedef Kokkos::View<double**, layout_right, device_scratch, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
73typedef Kokkos::View<double**, layout_left, device_scratch, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
75typedef Kokkos::View<double*, device_scratch, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
77typedef Kokkos::View<int*, device_scratch, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
81typedef Kokkos::View<double**, layout_right, host_scratch, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
83typedef Kokkos::View<double**, layout_left, host_scratch, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
85typedef Kokkos::View<double*, host_scratch, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
87typedef Kokkos::View<int*, host_scratch, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
91typedef Kokkos::View<double**, layout_right, device_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
93typedef Kokkos::View<double**, layout_left, device_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
95typedef Kokkos::View<double*, device_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
97typedef Kokkos::View<int*, device_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
101typedef Kokkos::View<double**, layout_right, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
103typedef Kokkos::View<double**, layout_left, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
105typedef Kokkos::View<double*, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
107typedef Kokkos::View<int*, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> >
111typedef Kokkos::View<double**, layout_right, device_memory_space>
113typedef Kokkos::View<double**, layout_left, device_memory_space>
115typedef Kokkos::View<double*, device_memory_space>
117typedef Kokkos::View<int*, device_memory_space>
121typedef Kokkos::View<double**, layout_right, host_execution_space>
123typedef Kokkos::View<double**, layout_left, host_execution_space>
125typedef Kokkos::View<double*, host_execution_space>
127typedef Kokkos::View<int*, host_execution_space>
137template<
bool B,
class T =
void >
141typename std::enable_if<1==T::rank,T>::type
createView(std::string str,
int dim_0,
int dim_1)
142{
return T(str, dim_0); }
145typename std::enable_if<2==T::rank,T>::type
createView(std::string str,
int dim_0,
int dim_1)
146{
return T(str, dim_0, dim_1); }
154#if COMPADRE_BUILD_ABBR == 1 || COMPADRE_BUILD_ABBR == 2
155# define compadre_assert_release(condition) do { \
156 if ( ! (condition)) { \
157 std::stringstream _ss_; \
158 _ss_ << __FILE__ << ":" << __LINE__ << ": FAIL:\n" << #condition \
160 throw std::logic_error(_ss_.str()); \
164# define compadre_assert_release(condition)
169#if COMPADRE_BUILD_ABBR == 1 || COMPADRE_BUILD_ABBR == 2
170# define compadre_kernel_assert_release(condition) do { \
171 if ( ! (condition)) \
172 Kokkos::abort(#condition); \
175# define compadre_kernel_assert_release(condition)
181# define compadre_assert_debug(condition) do { \
182 if ( ! (condition)) { \
183 std::stringstream _ss_; \
184 _ss_ << __FILE__ << ":" << __LINE__ << ": FAIL:\n" << #condition \
186 throw std::logic_error(_ss_.str()); \
189# define compadre_kernel_assert_debug(condition) do { \
190 if ( ! (condition)) \
191 Kokkos::abort(#condition); \
194# define compadre_assert_debug(condition)
195# define compadre_kernel_assert_debug(condition)
200#ifdef COMPADRE_EXTREME_DEBUG
201# define compadre_assert_extreme_debug(condition) do { \
202 if ( ! (condition)) { \
203 std::stringstream _ss_; \
204 _ss_ << __FILE__ << ":" << __LINE__ << ": FAIL:\n" << #condition \
206 throw std::logic_error(_ss_.str()); \
209# define compadre_kernel_assert_extreme_debug(condition) do { \
210 if ( ! (condition)) \
211 Kokkos::abort(#condition); \
214# define compadre_assert_extreme_debug(condition)
215# 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