File indexing completed on 2025-09-16 08:39:09
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_MATH_TUPLE_HPP_INCLUDED
0008 #define BOOST_MATH_TUPLE_HPP_INCLUDED
0009
0010 #include <boost/math/tools/config.hpp>
0011
0012 #ifdef BOOST_MATH_ENABLE_CUDA
0013
0014 #include <boost/math/tools/type_traits.hpp>
0015 #include <cuda/std/utility>
0016 #include <cuda/std/tuple>
0017
0018 namespace boost {
0019 namespace math {
0020
0021 using cuda::std::pair;
0022 using cuda::std::tuple;
0023
0024 using cuda::std::make_pair;
0025
0026 using cuda::std::tie;
0027 using cuda::std::get;
0028
0029 using cuda::std::tuple_size;
0030 using cuda::std::tuple_element;
0031
0032 namespace detail {
0033
0034 template <typename T>
0035 BOOST_MATH_GPU_ENABLED T&& forward(boost::math::remove_reference_t<T>& arg) noexcept
0036 {
0037 return static_cast<T&&>(arg);
0038 }
0039
0040 template <typename T>
0041 BOOST_MATH_GPU_ENABLED T&& forward(boost::math::remove_reference_t<T>&& arg) noexcept
0042 {
0043 static_assert(!boost::math::is_lvalue_reference<T>::value, "Cannot forward an rvalue as an lvalue.");
0044 return static_cast<T&&>(arg);
0045 }
0046
0047 }
0048
0049 template <typename T, typename... Ts>
0050 BOOST_MATH_GPU_ENABLED auto make_tuple(T&& t, Ts&&... ts)
0051 {
0052 return cuda::std::tuple<boost::math::decay_t<T>, boost::math::decay_t<Ts>...>(
0053 boost::math::detail::forward<T>(t), boost::math::detail::forward<Ts>(ts)...
0054 );
0055 }
0056
0057 }
0058 }
0059
0060 #else
0061
0062 #include <tuple>
0063
0064 namespace boost {
0065 namespace math {
0066
0067 using ::std::tuple;
0068 using ::std::pair;
0069
0070
0071 using ::std::ignore;
0072 using ::std::make_tuple;
0073 using ::std::tie;
0074 using ::std::get;
0075
0076
0077 using ::std::tuple_size;
0078 using ::std::tuple_element;
0079
0080
0081 using ::std::make_pair;
0082
0083 }
0084 }
0085
0086 #endif
0087
0088 #endif