20#if defined(__GNUC__) || defined(__clang__)
21#if defined(__CUDACC_VER_MAJOR__)
22#if __CUDACC_VER_MAJOR__ <= 11 && __CUDACC_VER_MINOR__ < 3
24#define MFEM_UNREACHABLE()
27#define MFEM_UNREACHABLE() __builtin_unreachable()
31#define MFEM_UNREACHABLE() __builtin_unreachable()
33#elif defined(_MSC_VER)
34#define MFEM_UNREACHABLE() __assume(0)
47template <
typename... T>
69template <
typename T0,
typename T1>
83template <
typename T0,
typename T1,
typename T2>
99template <
typename T0,
typename T1,
typename T2,
typename T3>
117template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4>
137template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5>
159template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6>
160struct tuple<T0, T1, T2, T3, T4, T5, T6>
183template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7>
184struct tuple<T0, T1, T2, T3, T4, T5, T6, T7>
196template <
typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7,
typename T8>
197struct tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8>
214template <
typename... T>
223template <
typename... T>
226 return tuple<T...> {args...};
229template <
class... Types>
234template <
class... Types>
236 std::integral_constant<std::size_t, sizeof...(Types)>
245template <
int i,
typename... T>
248 static_assert(i <
sizeof...(T));
249 if constexpr (i == 0)
253 if constexpr (i == 1)
257 if constexpr (i == 2)
261 if constexpr (i == 3)
265 if constexpr (i == 4)
269 if constexpr (i == 5)
273 if constexpr (i == 6)
277 if constexpr (i == 7)
281 if constexpr (i == 8)
293template <
int i,
typename... T>
296 static_assert(i <
sizeof...(T));
297 if constexpr (i == 0)
301 if constexpr (i == 1)
305 if constexpr (i == 2)
309 if constexpr (i == 3)
313 if constexpr (i == 4)
317 if constexpr (i == 5)
321 if constexpr (i == 6)
325 if constexpr (i == 7)
329 if constexpr (i == 8)
346template <
int i,
typename... T>
349 static_assert(i <
sizeof...(T));
350 if constexpr (i == 0)
354 if constexpr (i == 1)
358 if constexpr (i == 2)
362 if constexpr (i == 3)
366 if constexpr (i == 4)
370 if constexpr (i == 5)
374 if constexpr (i == 6)
378 if constexpr (i == 7)
382 if constexpr (i == 8)
398template <
typename... S,
typename... T,
int... i>
401 std::integer_sequence<int, i...>)
413template <
typename... S,
typename... T>
417 static_assert(
sizeof...(S) ==
sizeof...(T));
419 std::make_integer_sequence<
int,
static_cast<int>(
sizeof...(S))>());
430template <
typename... T,
int... i>
433 std::integer_sequence<int, i...>)
444template <
typename... T>
449 std::make_integer_sequence<
int,
static_cast<int>(
sizeof...(T))>());
460template <
typename... T,
int... i>
463 std::integer_sequence<int, i...>)
474template <
typename... T>
479 std::make_integer_sequence<
int,
static_cast<int>(
sizeof...(T))>());
492template <
typename... S,
typename... T,
int... i>
495 std::integer_sequence<int, i...>)
507template <
typename... S,
typename... T>
511 static_assert(
sizeof...(S) ==
sizeof...(T));
513 std::make_integer_sequence<
int,
static_cast<int>(
sizeof...(S))>());
524template <
typename... T,
int... i>
526 std::integer_sequence<int, i...>)
536template <
typename... T>
540 std::make_integer_sequence<
int,
static_cast<int>(
sizeof...(T))>());
553template <
typename... S,
typename... T,
int... i>
556 std::integer_sequence<int, i...>)
568template <
typename... S,
typename... T>
572 static_assert(
sizeof...(S) ==
sizeof...(T));
574 std::make_integer_sequence<
int,
static_cast<int>(
sizeof...(S))>());
586template <
typename... T,
int... i>
588 const tuple<T...>& x, std::integer_sequence<int, i...>)
602template <
typename... T,
int... i>
604 const real_t a, std::integer_sequence<int, i...>)
615template <
typename... T>
619 std::make_integer_sequence<
int,
static_cast<int>(
sizeof...(T))>());
628template <
typename... T>
632 std::make_integer_sequence<
int,
static_cast<int>(
sizeof...(T))>());
645template <
typename... S,
typename... T,
int... i>
648 std::integer_sequence<int, i...>)
660template <
typename... S,
typename... T>
664 static_assert(
sizeof...(S) ==
sizeof...(T));
666 std::make_integer_sequence<
int,
static_cast<int>(
sizeof...(S))>());
678template <
typename... T,
int... i>
680 const tuple<T...>& x, std::integer_sequence<int, i...>)
694template <
typename... T,
int... i>
696 const real_t a, std::integer_sequence<int, i...>)
707template <
typename... T>
711 std::make_integer_sequence<
int,
static_cast<int>(
sizeof...(T))>());
720template <
typename... T>
724 std::make_integer_sequence<
int,
static_cast<int>(
sizeof...(T))>());
734template <
typename... T, std::size_t... i>
736 std::integer_sequence<size_t, i...>)
739 (..., (
out << (i == 0 ?
"" :
", ") <<
get<i>(A)));
750template <
typename... T>
753 return print_helper(
out, A, std::make_integer_sequence<
size_t,
sizeof...(T)>());
766template <
typename lambda,
typename... T,
int... i>
768 std::integer_sequence<int, i...>)
782template <
typename lambda,
typename... T>
786 std::make_integer_sequence<
int,
static_cast<int>(
sizeof...(T))>());
792template <
typename lambda,
typename... T,
int... i>
794 std::integer_sequence<int, i...>)
808template <
typename lambda,
typename... T>
812 std::make_integer_sequence<
int,
static_cast<int>(
sizeof...(T))>());
823template <
size_t I,
class T>
828template <
size_t I,
class Head,
class... Tail>
836template <
class Head,
class... Tail>
851template <
typename... T>
867template <
typename... T>
877template <
typename... T1s,
typename... T2s>
882 return std::tuple<T1s..., T2s...> {};
MFEM_HOST_DEVICE constexpr auto plus_helper(const tuple< S... > &x, const tuple< T... > &y, std::integer_sequence< int, i... >)
A helper function for the + operator of tuples.
MFEM_HOST_DEVICE constexpr auto operator-(dual< value_type, gradient_type > x) -> dual< value_type, gradient_type >
unary negation of a dual number
MFEM_HOST_DEVICE constexpr auto operator+(dual< value_type, gradient_type > a, other_type b) -> dual< value_type, gradient_type >
addition of a dual number and a non-dual number
constexpr auto merge_mfem_tuples_as_empty_std_tuple(const mfem::future::tuple< T1s... > &, const mfem::future::tuple< T2s... > &)
Auxiliary template function that merges (concatenates) two mfem::future::tuple types into a single st...
MFEM_HOST_DEVICE tuple< T... > make_tuple(const T &... args)
helper function for combining a list of values into a tuple
gradient_type MFEM_HOST_DEVICE dual< value_type, gradient_type > & operator+=(dual< value_type, gradient_type > &a, const dual< value_type, gradient_type > &b)
MFEM_HOST_DEVICE constexpr auto div_helper(const tuple< S... > &x, const tuple< T... > &y, std::integer_sequence< int, i... >)
A helper function for the / operator of tuples.
MFEM_HOST_DEVICE constexpr auto unary_minus_helper(const tuple< T... > &x, std::integer_sequence< int, i... >)
A helper function for the - operator of tuples.
auto & print_helper(std::ostream &out, const tuple< T... > &A, std::integer_sequence< size_t, i... >)
helper used to implement printing a tuple of values
MFEM_HOST_DEVICE constexpr void plus_equals_helper(tuple< T... > &x, const tuple< T... > &y, std::integer_sequence< int, i... >)
A helper function for the += operator of tuples.
MFEM_HOST_DEVICE auto apply_helper(lambda f, tuple< T... > &args, std::integer_sequence< int, i... >)
A helper to apply a lambda to a tuple.
MFEM_HOST_DEVICE tuple(T...) -> tuple< T... >
Class template argument deduction rule for tuples.
MFEM_HOST_DEVICE dual< value_type, gradient_type > & operator-=(dual< value_type, gradient_type > &a, const dual< value_type, gradient_type > &b)
compound assignment (-) for dual numbers
std::ostream & operator<<(std::ostream &os, dual< value_type, gradient_type > A)
overload of operator<< for dual to work with work with standard output streams
MFEM_HOST_DEVICE constexpr auto mult_helper(const tuple< S... > &x, const tuple< T... > &y, std::integer_sequence< int, i... >)
A helper function for the * operator of tuples.
MFEM_HOST_DEVICE constexpr auto type(const tuple< T... > &values)
a function intended to be used for extracting the ith type from a tuple.
MFEM_HOST_DEVICE auto apply(lambda f, tuple< T... > &args)
a way of passing an n-tuple to a function that expects n separate arguments
MFEM_HOST_DEVICE constexpr void minus_equals_helper(tuple< T... > &x, const tuple< T... > &y, std::integer_sequence< int, i... >)
A helper function for the -= operator of tuples.
MFEM_HOST_DEVICE constexpr auto minus_helper(const tuple< S... > &x, const tuple< T... > &y, std::integer_sequence< int, i... >)
A helper function for the - operator of tuples.
MFEM_HOST_DEVICE constexpr auto operator*(const dual< value_type, gradient_type > &a, real_t b) -> dual< decltype(a.value *b), decltype(a.gradient *b)>
multiplication of a dual number and a non-dual number
MFEM_HOST_DEVICE constexpr auto operator/(const dual< value_type, gradient_type > &a, real_t b) -> dual< decltype(a.value/b), decltype(a.gradient/b)>
division of a dual number by a non-dual number
MFEM_HOST_DEVICE zero & get(zero &x)
let zero be accessed like a tuple
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
std::function< real_t(const Vector &)> f(real_t mass_coeff)
Trait for checking if a type if a mfem::tuple containing only mfem::tuple.
Trait for checking if a type is a mfem::tuple.
T7 v7
The eighth member of the tuple.
T0 v0
The first member of the tuple.
T2 v2
The third member of the tuple.
T1 v1
The second member of the tuple.
T5 v5
The sixth member of the tuple.
T4 v4
The fifth member of the tuple.
T6 v6
The seventh member of the tuple.
T3 v3
The fourth member of the tuple.
T7 v7
The eighth member of the tuple.
T6 v6
The seventh member of the tuple.
T3 v3
The fourth member of the tuple.
T0 v0
The first member of the tuple.
T1 v1
The second member of the tuple.
T4 v4
The fifth member of the tuple.
T2 v2
The third member of the tuple.
T5 v5
The sixth member of the tuple.
T6 v6
The seventh member of the tuple.
T0 v0
The first member of the tuple.
T1 v1
The second member of the tuple.
T2 v2
The third member of the tuple.
T4 v4
The fifth member of the tuple.
T5 v5
The sixth member of the tuple.
T3 v3
The fourth member of the tuple.
T4 v4
The fifth member of the tuple.
T5 v5
The sixth member of the tuple.
T2 v2
The third member of the tuple.
T0 v0
The first member of the tuple.
T3 v3
The fourth member of the tuple.
T1 v1
The second member of the tuple.
T4 v4
The fifth member of the tuple.
T2 v2
The third member of the tuple.
T3 v3
The fourth member of the tuple.
T1 v1
The second member of the tuple.
T0 v0
The first member of the tuple.
T1 v1
The second member of the tuple.
T0 v0
The first member of the tuple.
T3 v3
The fourth member of the tuple.
T2 v2
The third member of the tuple.
T0 v0
The first member of the tuple.
T2 v2
The third member of the tuple.
T1 v1
The second member of the tuple.
T1 v1
The second member of the tuple.
T0 v0
The first member of the tuple.
T0 v0
The first member of the tuple.
Head type
the type at the specified index
a struct used to determine the type at index I of a tuple
This is a class that mimics most of std::tuple's interface, except that it is usable in CUDA kernels ...