15 #ifndef __Intrepid2_ArgExtractor_HPP__
16 #define __Intrepid2_ArgExtractor_HPP__
18 #include "Intrepid2_ConfigDefs.hpp"
23 #include "Kokkos_Core.hpp"
29 template<
class reference_type>
32 template<
class ViewType,
class ...IntArgs>
33 static KOKKOS_INLINE_FUNCTION reference_type
get(
const ViewType &view,
const IntArgs&... intArgs)
42 template<
class reference_type>
45 template<
class ViewType,
class ...IntArgs>
46 static KOKKOS_INLINE_FUNCTION reference_type
get(
const ViewType &view,
const IntArgs&... intArgs)
48 return view(intArgs...);
55 template<
class reference_type,
int whichArg>
58 template<
bool B,
class T = reference_type >
59 using enable_if_t =
typename std::enable_if<B,T>::type;
61 template<
class ViewType,
class int_type,
int M=whichArg>
62 static KOKKOS_INLINE_FUNCTION
64 get(
const ViewType &view,
const int_type &i0)
69 template<
class ViewType,
class int_type,
class ...IntArgs,
int M=whichArg>
70 static KOKKOS_INLINE_FUNCTION
72 get(
const ViewType &view,
const int_type &i0,
const IntArgs&... intArgs)
77 template<
class ViewType,
class int_type,
int M=whichArg>
78 static KOKKOS_INLINE_FUNCTION
80 get(
const ViewType &view,
const int_type &i0,
const int_type &i1)
85 template<
class ViewType,
class int_type,
class ...IntArgs,
int M=whichArg>
86 static KOKKOS_INLINE_FUNCTION
88 get(
const ViewType &view,
const int_type &i0,
const int_type &i1,
const IntArgs&... intArgs)
93 template<
class ViewType,
class int_type,
int M=whichArg>
94 static KOKKOS_INLINE_FUNCTION
96 get(
const ViewType &view,
const int_type &i0,
const int_type &i1,
const int_type &i2)
101 template<
class ViewType,
class int_type,
class ...IntArgs,
int M=whichArg>
102 static KOKKOS_INLINE_FUNCTION
104 get(
const ViewType &view,
const int_type &i0,
const int_type &i1,
const int_type &i2,
const IntArgs&... intArgs)
109 template<
class ViewType,
class int_type,
int M=whichArg>
110 static KOKKOS_INLINE_FUNCTION
112 get(
const ViewType &view,
const int_type &i0,
const int_type &i1,
const int_type &i2,
const int_type &i3)
117 template<
class ViewType,
class int_type,
class ...IntArgs,
int M=whichArg>
118 static KOKKOS_INLINE_FUNCTION
120 get(
const ViewType &view,
const int_type &i0,
const int_type &i1,
const int_type &i2,
const int_type &i3,
const IntArgs&... intArgs)
125 template<
class ViewType,
class int_type,
int M=whichArg>
126 static KOKKOS_INLINE_FUNCTION
128 get(
const ViewType &view,
const int_type &i0,
const int_type &i1,
const int_type &i2,
const int_type &i3,
const int_type &i4)
133 template<
class ViewType,
class int_type,
class ...IntArgs,
int M=whichArg>
134 static KOKKOS_INLINE_FUNCTION
136 get(
const ViewType &view,
const int_type &i0,
const int_type &i1,
const int_type &i2,
const int_type &i3,
const int_type &i4,
const IntArgs&... intArgs)
141 template<
class ViewType,
class int_type,
int M=whichArg>
142 static KOKKOS_INLINE_FUNCTION
144 get(
const ViewType &view,
const int_type &i0,
const int_type &i1,
const int_type &i2,
const int_type &i3,
const int_type &i4,
const int_type &i5)
149 template<
class ViewType,
class int_type,
class ...IntArgs,
int M=whichArg>
150 static KOKKOS_INLINE_FUNCTION
152 get(
const ViewType &view,
const int_type &i0,
const int_type &i1,
const int_type &i2,
const int_type &i3,
const int_type &i4,
const int_type &i5,
const IntArgs&... intArgs)
169 template<
class ViewType,
class ...IntArgs>
170 static KOKKOS_INLINE_FUNCTION
171 enable_if_t<whichArg >=
sizeof...(IntArgs), reference_type>
172 get(
const ViewType &view,
const IntArgs&... intArgs)
175 Kokkos::abort(
"Intrepid2::SingleArgExtractor: calling SingleArgExtractor with out-of-bounds argument\n");
#define INTREPID2_TEST_FOR_EXCEPTION_DEVICE_SAFE(test, x, msg)
Header function for Intrepid2::Util class and other utility functions.
Implementation of an assert that can safely be called from device code.
Contains definitions of custom data types in Intrepid2.