Automatic Differentiation
 
Loading...
Searching...
No Matches
ref_type_for_opencl.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_OPENCL_REF_TYPE_FOR_OPENCL_HPP
2#define STAN_MATH_OPENCL_REF_TYPE_FOR_OPENCL_HPP
3#ifdef STAN_OPENCL
4
8
9namespace stan {
10namespace math {
24template <typename T, typename = void>
26 using T_val = std::remove_reference_t<T>;
27 using T_plain_col_major = std::conditional_t<
28 std::is_same<typename Eigen::internal::traits<T_val>::XprKind,
29 Eigen::MatrixXpr>::value,
30 Eigen::Matrix<value_type_t<T>, T_val::RowsAtCompileTime,
31 T_val::ColsAtCompileTime>,
32 Eigen::Array<value_type_t<T>, T_val::RowsAtCompileTime,
33 T_val::ColsAtCompileTime>>;
36 = std::conditional_t<std::is_rvalue_reference<T>::value, T_val, const T&>;
37 using T_val_derived = std::decay_t<decltype(std::declval<T_val>().derived())>;
38 // Setting Outer stride of Ref to 0 (default) won't actually check that
39 // expression has contiguous outer stride. Instead we need to check that
40 // evaluator flags contain LinearAccessBit and PacketAccessBit.
41 using type = std::conditional_t<
42 Eigen::internal::traits<Eigen::Ref<std::decay_t<T_plain_col_major>>>::
43 template match<T_val_derived>::MatchAtCompileTime
44 && (Eigen::internal::evaluator<T_val_derived>::Flags
45 & Eigen::LinearAccessBit)
46 && (Eigen::internal::evaluator<T_val_derived>::Flags
47 & Eigen::PacketAccessBit),
49};
50
51template <typename T>
53 using type = std::conditional_t<std::is_rvalue_reference<T>::value,
54 std::remove_reference_t<T>, const T&>;
55};
56
57template <typename T>
59 using type =
61};
62
63template <typename T>
65
66} // namespace math
67} // namespace stan
68
69#endif
70#endif
Equivalent to Eigen::Matrix, except that the data is stored in (hopefully pinned) memory,...
require_t< is_arena_matrix< std::decay_t< T > > > require_arena_matrix_t
Require type satisfies is_arena_matrix.
require_not_t< is_eigen< std::decay_t< T > > > require_not_eigen_t
Require type does not satisfy is_eigen.
Definition is_eigen.hpp:60
typename ref_type_for_opencl< T >::type ref_type_for_opencl_t
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Definition fvar.hpp:9
typename ref_type_for_opencl< typename std::decay_t< T >::Base >::type type
std::conditional_t< std::is_rvalue_reference< T >::value, std::remove_reference_t< T >, const T & > type
std::remove_reference_t< T > T_val
std::conditional_t< std::is_same< typename Eigen::internal::traits< T_val >::XprKind, Eigen::MatrixXpr >::value, Eigen::Matrix< value_type_t< T >, T_val::RowsAtCompileTime, T_val::ColsAtCompileTime >, Eigen::Array< value_type_t< T >, T_val::RowsAtCompileTime, T_val::ColsAtCompileTime > > T_plain_col_major
std::decay_t< decltype(std::declval< T_val >().derived())> T_val_derived
std::conditional_t< Eigen::internal::traits< Eigen::Ref< std::decay_t< T_plain_col_major > > >::template match< T_val_derived >::MatchAtCompileTime &&(Eigen::internal::evaluator< T_val_derived >::Flags &Eigen::LinearAccessBit) &&(Eigen::internal::evaluator< T_val_derived >::Flags &Eigen::PacketAccessBit), T_optionally_ref, T_pinned > type
std::conditional_t< std::is_rvalue_reference< T >::value, T_val, const T & > T_optionally_ref
Determines appropriate type for assigning expression of given type to, so that the resulting type has...