Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/TiledArray/tensor/type_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,26 @@ template <typename... Ts>
inline constexpr const bool is_tensor_of_tensor_v =
is_tensor_of_tensor<Ts...>::value;

////////////////////////////////////////////////////////////////////////////////
/// It is sometimes desirable to distinguish between DistArrays with
/// tensor-of-scalars tiles vs tensor-of-tensors tiles.

///
/// True if the @tparam Array is a DistArray with tensor-of-scalars tile type.
/// e.g. DistArray<Tensor<double>>;
///
template <typename Array>
concept array_tos =
is_array_v<Array> && is_tensor_v<typename Array::value_type>;

///
/// True if the @tparam Array is a DistArray with tensor-of-tensors tile type.
/// e.g. DistArray<Tensor<Tensor<double>>>;
///
template <typename Array>
concept array_tot =
is_array_v<Array> && is_tensor_of_tensor_v<typename Array::value_type>;

////////////////////////////////////////////////////////////////////////////////

template <typename T1, typename T2, typename Enabler = void>
Expand Down
Loading