Intrepid2
Classes | Macros | Functions | Variables
Intrepid2_Utils.hpp File Reference

Header function for Intrepid2::Util class and other utility functions. More...

#include "Intrepid2_ConfigDefs.hpp"
#include "Intrepid2_Types.hpp"
#include "Kokkos_Core.hpp"
#include "Kokkos_Macros.hpp"

Go to the source code of this file.

Classes

struct  Intrepid2::ScalarTraits< T >
 scalar type traits More...
 
struct  Intrepid2::ScalarTraits< float >
 Built in support for float. More...
 
struct  Intrepid2::ScalarTraits< double >
 Built in support for double. More...
 
struct  Intrepid2::ScalarTraits< int >
 Built in support for int. More...
 
struct  Intrepid2::ScalarTraits< long int >
 Built in support for long int. More...
 
struct  Intrepid2::ScalarTraits< long long >
 Built in support for long long. More...
 
struct  Intrepid2::ExecSpace< ViewSpaceType, UserSpaceType >
 space overload More...
 
struct  Intrepid2::ExecSpace< ViewSpaceType, void >
 space overload More...
 
struct  Intrepid2::DeduceLayout< ViewType >
 layout deduction (temporary meta-function) More...
 
class  Intrepid2::Util< T >
 small utility functions More...
 
struct  Intrepid2::NaturalLayoutForType< ValueType >
 Define layout that will allow us to wrap Sacado Scalar objects in Views without copying. More...
 

Macros

#define INTREPID2_TEST_FOR_WARNING(test, msg)
 
#define INTREPID2_TEST_FOR_EXCEPTION(test, x, msg)
 
#define INTREPID2_TEST_FOR_EXCEPTION_DEVICE_SAFE(test, x, msg)
 
#define INTREPID2_TEST_FOR_ABORT(test, msg)
 
#define INTREPID2_TEST_FOR_DEBUG_ABORT(test, info, msg)
 

Functions

template<typename IdxType , typename DimType , typename IterType >
static
KOKKOS_FORCEINLINE_FUNCTION
void 
Intrepid2::unrollIndex (IdxType &i, IdxType &j, const DimType, const DimType dim1, const IterType iter)
 
template<typename IdxType , typename DimType , typename IterType >
static
KOKKOS_FORCEINLINE_FUNCTION
void 
Intrepid2::unrollIndex (IdxType &i, IdxType &j, IdxType &k, const DimType dim0, const DimType dim1, const DimType dim2, const IterType iter)
 
template<typename T >
static
KOKKOS_FORCEINLINE_FUNCTION T 
Intrepid2::min (const T &a, const T &b)
 
template<typename T >
static
KOKKOS_FORCEINLINE_FUNCTION T 
Intrepid2::max (const T &a, const T &b)
 
template<typename T >
static
KOKKOS_FORCEINLINE_FUNCTION T 
Intrepid2::abs (const T &a)
 
template<typename T >
KOKKOS_FORCEINLINE_FUNCTION
constexpr std::enable_if
< !std::is_pod< T >::value,
typename ScalarTraits< T >
::scalar_type >::type 
Intrepid2::get_scalar_value (const T &obj)
 functions returning the scalar value. for pod types, they return the input object itself. of other types it returns the member function val() of the type T. For Sacado Fad types it returns the scalar value.
 
template<typename T >
KOKKOS_FORCEINLINE_FUNCTION
constexpr std::enable_if
< std::is_pod< T >::value,
typename ScalarTraits< T >
::scalar_type >::type 
Intrepid2::get_scalar_value (const T &obj)
 
template<typename T , typename... P>
KOKKOS_INLINE_FUNCTION
constexpr std::enable_if
< std::is_pod< T >::value,
unsigned >::type 
Intrepid2::dimension_scalar (const Kokkos::DynRankView< T, P...>)
 specialization of functions for pod types, returning the scalar dimension (1 for pod types) of a view these functions are specialized in Sacado and they return the scalar dimension (i.e. the dimension of the type w.r.t. the type associated to the pointer type).
 
template<typename T , typename... P>
KOKKOS_INLINE_FUNCTION
constexpr std::enable_if
< std::is_pod< T >::value,
unsigned >::type 
Intrepid2::dimension_scalar (const Kokkos::View< T, P...> view)
 
template<typename T >
static
KOKKOS_FORCEINLINE_FUNCTION
ordinal_type 
Intrepid2::get_dimension_scalar (const T view)
 
template<class ViewType , class... DimArgs>
ViewType Intrepid2::getMatchingViewWithLabel (ViewType &view, const std::string &label, DimArgs...dims)
 Creates and returns a view that matches the provided view in Kokkos Layout. More...
 
template<typename Scalar >
constexpr int Intrepid2::getVectorSizeForHierarchicalParallelism ()
 Returns a vector size to be used for the provided Scalar type in the context of hierarchically-parallel Kokkos functor execution.
 
template<typename ViewType >
KOKKOS_INLINE_FUNCTION
constexpr unsigned 
Intrepid2::getScalarDimensionForView (const ViewType &view)
 Returns the size of the Scalar dimension for the View. This is 0 for non-AD types. This method is useful for sizing scratch storage in hierarchically parallel kernels. Whereas get_dimension_scalar() returns 1 for POD types, this returns 0 for POD types.
 

Variables

const int Intrepid2::VECTOR_SIZE = 1
 
const int Intrepid2::FAD_VECTOR_SIZE = 1
 

Detailed Description

Header function for Intrepid2::Util class and other utility functions.

Author
Created by P. Bochev and D. Ridzal. Kokkorized by Kyungjoo Kim

Definition in file Intrepid2_Utils.hpp.

Macro Definition Documentation

#define INTREPID2_TEST_FOR_ABORT (   test,
  msg 
)
Value:
if (test) { \
printf("[Intrepid2] Error in file %s, line %d\n",__FILE__,__LINE__); \
printf(" Test that evaluated to true: %s\n", #test); \
printf(" %s \n", msg); \
Kokkos::abort( "[Intrepid2] Abort\n"); \
}

Definition at line 99 of file Intrepid2_Utils.hpp.

#define INTREPID2_TEST_FOR_DEBUG_ABORT (   test,
  info,
  msg 
)
Value:
if (!(info) && (test)) { \
printf("[Intrepid2] Error in file %s, line %d\n",__FILE__,__LINE__); \
printf(" Test that evaluated to true: %s\n", #test); \
printf(" %s \n", msg); \
info = true ; \
Kokkos::abort( "[Intrepid2] Abort\n"); \
}

Definition at line 117 of file Intrepid2_Utils.hpp.

#define INTREPID2_TEST_FOR_EXCEPTION (   test,
  x,
  msg 
)
Value:
if (test) { \
printf("[Intrepid2] Error in file %s, line %d\n",__FILE__,__LINE__); \
printf(" Test that evaluated to true: %s\n", #test); \
printf(" %s \n", msg); \
throw x(msg); \
}

Definition at line 79 of file Intrepid2_Utils.hpp.

#define INTREPID2_TEST_FOR_EXCEPTION_DEVICE_SAFE (   test,
  x,
  msg 
)
Value:
if (test) { \
printf("[Intrepid2] Error in file %s, line %d\n",__FILE__,__LINE__); \
printf(" Test that evaluated to true: %s\n", #test); \
printf(" %s \n", msg); \
throw x(msg); \
}

Definition at line 88 of file Intrepid2_Utils.hpp.

#define INTREPID2_TEST_FOR_WARNING (   test,
  msg 
)
Value:
if (test) { \
printf("[Intrepid2] Warning in file %s, line %d\n",__FILE__,__LINE__); \
printf(" Test that evaluated to true: %s\n", #test); \
printf(" %s \n", msg); \
}

Definition at line 72 of file Intrepid2_Utils.hpp.