26 #ifndef TILEDARRAY_TENSOR_TYPE_TRAITS_H__INCLUDED
27 #define TILEDARRAY_TENSOR_TYPE_TRAITS_H__INCLUDED
29 #include <TiledArray/config.h>
32 #include <type_traits>
38 class aligned_allocator;
47 template <
typename T,
typename A = Eigen::aligned_allocator<T>>
53 class BipartitePermutation;
62 template <
typename T,
typename R,
typename = Tensor<std::remove_const_t<T>>>
63 class TensorInterface;
76 template <
typename... Ts>
78 template <
typename... Ts>
84 template <
typename T,
typename A>
87 template <
typename... Args>
102 template <
typename T,
typename A>
105 template <
typename T,
typename... Args>
109 template <
typename T>
113 template <
typename T>
120 template <
typename T>
122 static constexpr
bool value =
126 template <
typename T1,
typename T2,
typename... Ts>
128 static constexpr
bool value =
134 template <
typename... Ts>
140 template <
typename T>
145 template <
typename T1,
typename T2,
typename... Ts>
147 static constexpr
bool value =
154 template <
typename... Ts>
157 template <
typename T,
typename Enabler =
void>
160 template <
typename T,
typename A>
163 template <
typename T>
168 template <
typename T>
174 template <
typename T>
177 template <
typename T,
typename A>
180 template <
typename T,
typename R,
typename OpResult>
184 template <
typename T>
188 template <
typename T>
192 template <
typename... Ts>
198 template <
typename T>
201 template <
typename T1,
typename T2,
typename... Ts>
210 template <
typename... Ts>
216 template <
typename T>
219 template <
typename T>
222 template <
typename... Ts>
228 template <
typename T>
231 template <
typename T1,
typename T2,
typename... Ts>
233 static constexpr
bool value =
239 template <
typename... Ts>
243 template <
typename Enabler,
typename ReduceOp,
typename Result,
247 template <
typename ReduceOp,
typename Result,
typename... Args>
249 std::void_t<decltype(std::declval<ReduceOp&>()(
250 std::declval<Result&>(), std::declval<const Args*>()...))>,
251 ReduceOp, Result, Args...> :
public std::true_type {};
253 template <
typename ReduceOp,
typename Result,
typename... Args>
258 #ifdef TILEDARRAY_HAS_CUDA
259 template <
typename T>
260 struct is_cuda_tile :
public std::false_type {};
262 template <
typename T>
263 struct is_cuda_tile<
Tile<T>> :
public is_cuda_tile<T> {};
265 template <
typename T,
typename Op>
266 struct is_cuda_tile<LazyArrayTile<T,
Op>>
267 :
public is_cuda_tile<typename LazyArrayTile<T, Op>::eval_type> {};
269 template <
typename T>
270 static constexpr
const auto is_cuda_tile_v = is_cuda_tile<T>::value;
274 template <
typename Tensor,
typename Enabler =
void>
277 template <
typename Tensor>
279 std::enable_if_t<!is_tensor_of_tensor_v<Tensor>>> {
283 template <
typename Tensor>
285 std::enable_if_t<is_tensor_of_tensor_v<Tensor>>> {
289 template <
typename Tensor>
292 template <
typename T,
typename Enabler =
void>
300 :
public std::true_type {};
304 :
public std::true_type {};
306 template <
typename T>
309 template <
typename T>
310 static constexpr
const auto is_bipartite_permutation_v =
311 std::is_same_v<T, TiledArray::BipartitePermutation>;
313 template <
typename T>
314 static constexpr
const auto is_bipartite_permutable_v =
315 is_free_function_permute_anyreturn_v<
329 template <
typename Ordinal,
typename Enabler =
void>
335 static constexpr
const auto type = OrdinalType::RowMajor;
339 template <
typename T>
342 std::decay_t<decltype(std::declval<const T&>().range())>>::type;
349 #endif // TILEDARRAY_TENSOR_TYPE_TRAITS_H__INCLUDED