Compadre  1.5.7
Macros | Typedefs | Functions | Variables
Compadre_Typedefs.hpp File Reference
#include "Compadre_Config.h"
#include <Kokkos_Core.hpp>
#include <Kokkos_Random.hpp>
#include <type_traits>
#include <vector>
#include <sstream>
#include <cstddef>
#include <functional>
#include <string>

Go to the source code of this file.

Macros

#define TO_GLOBAL(variable)   ((global_index_type)variable)
 
#define compadre_assert_release(condition)
 compadre_assert_release is used for assertions that should always be checked, but generally are not expensive to verify or are not called frequently. More...
 
#define compadre_kernel_assert_release(condition)
 compadre_kernel_assert_release is similar to compadre_assert_release, but is a call on the device, namely inside of a function marked KOKKOS_INLINE_FUNCTION More...
 
#define compadre_assert_debug(condition)
 compadre_assert_debug is used for assertions that are checked in loops, as these significantly impact performance. More...
 
#define compadre_kernel_assert_debug(condition)
 
#define compadre_assert_extreme_debug(condition)
 compadre_kernel_assert_debug is similar to compadre_assert_debug, but is a call on the device, namely inside of a function marked KOKKOS_INLINE_FUNCTION More...
 
#define compadre_kernel_assert_extreme_debug(condition)
 

Typedefs

typedef double scalar_type
 
typedef int local_index_type
 
typedef std::size_t global_index_type
 
typedef Kokkos::DefaultHostExecutionSpace host_execution_space
 
typedef Kokkos::DefaultExecutionSpace device_execution_space
 
typedef host_execution_space::memory_space host_memory_space
 
typedef device_execution_space::memory_space device_memory_space
 
typedef Kokkos::TeamPolicy< device_execution_spaceteam_policy
 
typedef team_policy::member_type member_type
 
typedef Kokkos::TeamPolicy< host_execution_spacehost_team_policy
 
typedef host_team_policy::member_type host_member_type
 
typedef Kokkos::LayoutRight layout_right
 
typedef Kokkos::LayoutLeft layout_left
 
typedef Kokkos::View< double **, layout_right, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_matrix_right_type
 
typedef Kokkos::View< double **, layout_left, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_matrix_left_type
 
typedef Kokkos::View< double *, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_vector_type
 
typedef Kokkos::View< int *, Kokkos::MemoryTraits< Kokkos::Unmanaged > > scratch_local_index_type
 
typedef Kokkos::View< double **, layout_right, host_execution_space, Kokkos::MemoryTraits< Kokkos::Unmanaged > > host_scratch_matrix_right_type
 
typedef Kokkos::View< double **, layout_left, host_execution_space, Kokkos::MemoryTraits< Kokkos::Unmanaged > > host_scratch_matrix_left_type
 
typedef Kokkos::View< double *, host_execution_space, Kokkos::MemoryTraits< Kokkos::Unmanaged > > host_scratch_vector_type
 
typedef Kokkos::View< int *, host_execution_space, Kokkos::MemoryTraits< Kokkos::Unmanaged > > host_scratch_local_index_type
 
typedef Kokkos::View< double **, layout_right, device_memory_spacedevice_managed_matrix_right_type
 
typedef Kokkos::View< double **, layout_left, device_memory_spacedevice_managed_matrix_left_type
 
typedef Kokkos::View< double *, device_memory_spacedevice_managed_vector_type
 
typedef Kokkos::View< int *, device_memory_spacedevice_managed_local_index_type
 
typedef Kokkos::View< double **, layout_right, host_execution_spacehost_managed_matrix_right_type
 
typedef Kokkos::View< double **, layout_left, host_execution_spacehost_managed_matrix_left_type
 
typedef Kokkos::View< double *, host_execution_spacehost_managed_vector_type
 
typedef Kokkos::View< int *, host_execution_spacehost_managed_local_index_type
 
typedef Kokkos::Random_XorShift64_Pool pool_type
 
typedef pool_type::generator_type generator_type
 
using KokkosInitArguments = Kokkos::InitArguments
 
template<bool B, class T = void>
using enable_if_t = typename std::enable_if< B, T >::type
 

Functions

template<typename T >
std::enable_if< 1==T::rank, T >::type createView (std::string str, int dim_0, int dim_1)
 
template<typename T >
std::enable_if< 2==T::rank, T >::type createView (std::string str, int dim_0, int dim_1)
 

Variables

constexpr char KOKKOS_THREADS_ARG [] = "--kokkos-threads"
 

Macro Definition Documentation

◆ compadre_assert_debug

#define compadre_assert_debug (   condition)

compadre_assert_debug is used for assertions that are checked in loops, as these significantly impact performance.

When NDEBUG is set, these conditions are not checked.

Definition at line 175 of file Compadre_Typedefs.hpp.

◆ compadre_assert_extreme_debug

#define compadre_assert_extreme_debug (   condition)

compadre_kernel_assert_debug is similar to compadre_assert_debug, but is a call on the device, namely inside of a function marked KOKKOS_INLINE_FUNCTION

Definition at line 195 of file Compadre_Typedefs.hpp.

◆ compadre_assert_release

#define compadre_assert_release (   condition)
Value:
do { \
if ( ! (condition)) { \
std::stringstream _ss_; \
_ss_ << __FILE__ << ":" << __LINE__ << ": FAIL:\n" << #condition \
<< "\n"; \
throw std::logic_error(_ss_.str()); \
} \
} while (0)

compadre_assert_release is used for assertions that should always be checked, but generally are not expensive to verify or are not called frequently.


Definition at line 143 of file Compadre_Typedefs.hpp.

◆ compadre_kernel_assert_debug

#define compadre_kernel_assert_debug (   condition)

Definition at line 176 of file Compadre_Typedefs.hpp.

◆ compadre_kernel_assert_extreme_debug

#define compadre_kernel_assert_extreme_debug (   condition)

Definition at line 196 of file Compadre_Typedefs.hpp.

◆ compadre_kernel_assert_release

#define compadre_kernel_assert_release (   condition)
Value:
do { \
if ( ! (condition)) \
Kokkos::abort(#condition); \
} while (0)

compadre_kernel_assert_release is similar to compadre_assert_release, but is a call on the device, namely inside of a function marked KOKKOS_INLINE_FUNCTION

Definition at line 154 of file Compadre_Typedefs.hpp.

◆ TO_GLOBAL

#define TO_GLOBAL (   variable)    ((global_index_type)variable)

Definition at line 30 of file Compadre_Typedefs.hpp.

Typedef Documentation

◆ device_execution_space

typedef Kokkos::DefaultExecutionSpace device_execution_space

Definition at line 36 of file Compadre_Typedefs.hpp.

◆ device_managed_local_index_type

Definition at line 85 of file Compadre_Typedefs.hpp.

◆ device_managed_matrix_left_type

Definition at line 81 of file Compadre_Typedefs.hpp.

◆ device_managed_matrix_right_type

Definition at line 79 of file Compadre_Typedefs.hpp.

◆ device_managed_vector_type

typedef Kokkos::View<double*, device_memory_space> device_managed_vector_type

Definition at line 83 of file Compadre_Typedefs.hpp.

◆ device_memory_space

typedef device_execution_space::memory_space device_memory_space

Definition at line 43 of file Compadre_Typedefs.hpp.

◆ enable_if_t

template<bool B, class T = void>
using enable_if_t = typename std::enable_if<B,T>::type

Definition at line 127 of file Compadre_Typedefs.hpp.

◆ generator_type

typedef pool_type::generator_type generator_type

Definition at line 99 of file Compadre_Typedefs.hpp.

◆ global_index_type

typedef std::size_t global_index_type

Definition at line 27 of file Compadre_Typedefs.hpp.

◆ host_execution_space

typedef Kokkos::DefaultHostExecutionSpace host_execution_space

Definition at line 35 of file Compadre_Typedefs.hpp.

◆ host_managed_local_index_type

Definition at line 95 of file Compadre_Typedefs.hpp.

◆ host_managed_matrix_left_type

Definition at line 91 of file Compadre_Typedefs.hpp.

◆ host_managed_matrix_right_type

Definition at line 89 of file Compadre_Typedefs.hpp.

◆ host_managed_vector_type

typedef Kokkos::View<double*, host_execution_space> host_managed_vector_type

Definition at line 93 of file Compadre_Typedefs.hpp.

◆ host_member_type

Definition at line 51 of file Compadre_Typedefs.hpp.

◆ host_memory_space

typedef host_execution_space::memory_space host_memory_space

Definition at line 39 of file Compadre_Typedefs.hpp.

◆ host_scratch_local_index_type

typedef Kokkos::View<int*, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> > host_scratch_local_index_type

Definition at line 75 of file Compadre_Typedefs.hpp.

◆ host_scratch_matrix_left_type

typedef Kokkos::View<double**, layout_left, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> > host_scratch_matrix_left_type

Definition at line 71 of file Compadre_Typedefs.hpp.

◆ host_scratch_matrix_right_type

typedef Kokkos::View<double**, layout_right, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> > host_scratch_matrix_right_type

Definition at line 69 of file Compadre_Typedefs.hpp.

◆ host_scratch_vector_type

typedef Kokkos::View<double*, host_execution_space, Kokkos::MemoryTraits<Kokkos::Unmanaged> > host_scratch_vector_type

Definition at line 73 of file Compadre_Typedefs.hpp.

◆ host_team_policy

typedef Kokkos::TeamPolicy<host_execution_space> host_team_policy

Definition at line 50 of file Compadre_Typedefs.hpp.

◆ KokkosInitArguments

using KokkosInitArguments = Kokkos::InitArguments

Definition at line 122 of file Compadre_Typedefs.hpp.

◆ layout_left

typedef Kokkos::LayoutLeft layout_left

Definition at line 55 of file Compadre_Typedefs.hpp.

◆ layout_right

typedef Kokkos::LayoutRight layout_right

Definition at line 54 of file Compadre_Typedefs.hpp.

◆ local_index_type

typedef int local_index_type

Definition at line 26 of file Compadre_Typedefs.hpp.

◆ member_type

typedef team_policy::member_type member_type

Definition at line 48 of file Compadre_Typedefs.hpp.

◆ pool_type

typedef Kokkos::Random_XorShift64_Pool pool_type

Definition at line 98 of file Compadre_Typedefs.hpp.

◆ scalar_type

typedef double scalar_type

Data types in Compadre Toolkit:

  • Intention is to do local work, i.e. on a single node, so the default ordinal is local_index_type
  • When doing pointer arithmetic, it is possible to overflow local_index_type, so use global_index_type

Definition at line 25 of file Compadre_Typedefs.hpp.

◆ scratch_local_index_type

typedef Kokkos::View<int*, Kokkos::MemoryTraits<Kokkos::Unmanaged> > scratch_local_index_type

Definition at line 65 of file Compadre_Typedefs.hpp.

◆ scratch_matrix_left_type

typedef Kokkos::View<double**, layout_left, Kokkos::MemoryTraits<Kokkos::Unmanaged> > scratch_matrix_left_type

Definition at line 61 of file Compadre_Typedefs.hpp.

◆ scratch_matrix_right_type

typedef Kokkos::View<double**, layout_right, Kokkos::MemoryTraits<Kokkos::Unmanaged> > scratch_matrix_right_type

Definition at line 59 of file Compadre_Typedefs.hpp.

◆ scratch_vector_type

typedef Kokkos::View<double*, Kokkos::MemoryTraits<Kokkos::Unmanaged> > scratch_vector_type

Definition at line 63 of file Compadre_Typedefs.hpp.

◆ team_policy

typedef Kokkos::TeamPolicy<device_execution_space> team_policy

Definition at line 47 of file Compadre_Typedefs.hpp.

Function Documentation

◆ createView() [1/2]

template<typename T >
std::enable_if<1==T::rank,T>::type createView ( std::string  str,
int  dim_0,
int  dim_1 
)

Definition at line 130 of file Compadre_Typedefs.hpp.

◆ createView() [2/2]

template<typename T >
std::enable_if<2==T::rank,T>::type createView ( std::string  str,
int  dim_0,
int  dim_1 
)

Definition at line 134 of file Compadre_Typedefs.hpp.

Variable Documentation

◆ KOKKOS_THREADS_ARG

constexpr char KOKKOS_THREADS_ARG[] = "--kokkos-threads"
constexpr

Definition at line 123 of file Compadre_Typedefs.hpp.