10 #ifndef EIGEN_CXX11_TENSOR_TENSOR_META_H 11 #define EIGEN_CXX11_TENSOR_TENSOR_META_H 15 template<
bool cond>
struct Cond {};
17 template<
typename T1,
typename T2> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
18 const T1& choose(
Cond<true>,
const T1& first,
const T2&) {
22 template<
typename T1,
typename T2> EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
23 const T2& choose(
Cond<false>,
const T1&,
const T2& second) {
28 template <
typename T,
typename X,
typename Y>
29 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
30 T divup(
const X x,
const Y y) {
31 return static_cast<T>((x + y - 1) / y);
35 EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
36 T divup(
const T x,
const T y) {
37 return static_cast<T>((x + y - 1) / y);
41 static const size_t size = n;
44 static const size_t size = 1;
49 template <
typename Scalar,
typename Device>
55 #if defined(EIGEN_USE_GPU) && defined(__CUDACC__) && defined(EIGEN_HAS_CUDA_FP16) 59 static const int size = 2;
86 #if defined(EIGEN_USE_SYCL) 90 static const int size = 1;
110 template <
typename U,
typename V>
struct Tuple {
115 typedef U first_type;
116 typedef V second_type;
118 EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
119 Tuple() : first(), second() {}
121 EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
122 Tuple(
const U& f,
const V& s) : first(f), second(s) {}
124 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
125 Tuple& operator= (
const Tuple& rhs) {
126 if (&rhs ==
this)
return *
this;
132 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
133 void swap(Tuple& rhs) {
135 swap(first, rhs.first);
136 swap(second, rhs.second);
140 template <
typename U,
typename V>
141 EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
143 return (x.first == y.first && x.second == y.second);
146 template <
typename U,
typename V>
147 EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
155 EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE
IndexPair() : first(0), second(0) {}
156 EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE IndexPair(Idx f, Idx s) : first(f), second(s) {}
168 #ifdef EIGEN_HAS_SFINAE 171 template<
typename IndexType,
Index... Is>
172 EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
173 array<
Index,
sizeof...(Is)> customIndices2Array(IndexType& idx, numeric_list<Index, Is...>) {
174 return { idx[Is]... };
176 template<
typename IndexType>
177 EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
183 template<
typename Index, std::
size_t NumIndices,
typename IndexType>
184 EIGEN_CONSTEXPR EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
186 return customIndices2Array(idx,
typename gen_numeric_list<Index, NumIndices>::type{});
190 template <
typename B,
typename D>
194 typedef char (&yes)[1];
195 typedef char (&no)[2];
197 template <
typename BB,
typename DD>
200 operator BB*()
const;
205 static yes check(D*, T);
206 static no check(
B*,
int);
208 static const bool value =
sizeof(check(Host<B,D>(),
int())) ==
sizeof(yes);
218 #endif // EIGEN_CXX11_TENSOR_TENSOR_META_H Definition: TensorMeta.h:154
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:85
Definition: TensorMeta.h:40
Definition: GenericPacketMath.h:96
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:33
Definition: EmulateArray.h:21
Definition: BandTriangularSolver.h:13
Definition: TensorMeta.h:50
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:178
Definition: TensorMeta.h:15
Definition: TensorMeta.h:110