Skip to content

Commit 631f8ed

Browse files
committed
Adds array_tos and array_tot concepts.
1 parent 4765318 commit 631f8ed

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/TiledArray/tensor/type_traits.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,26 @@ template <typename... Ts>
176176
inline constexpr const bool is_tensor_of_tensor_v =
177177
is_tensor_of_tensor<Ts...>::value;
178178

179+
////////////////////////////////////////////////////////////////////////////////
180+
/// It is sometimes desirable to distinguish between DistArrays with
181+
/// tensor-of-scalars tiles vs tensor-of-tensors tiles.
182+
183+
///
184+
/// True if the @tparam Array is a DistArray with tensor-of-scalars tile type.
185+
/// e.g. DistArray<Tensor<double>>;
186+
///
187+
template <typename Array>
188+
concept array_tos =
189+
is_array_v<Array> && is_tensor_v<typename Array::value_type>;
190+
191+
///
192+
/// True if the @tparam Array is a DistArray with tensor-of-tensors tile type.
193+
/// e.g. DistArray<Tensor<Tensor<double>>>;
194+
///
195+
template <typename Array>
196+
concept array_tot =
197+
is_array_v<Array> && is_tensor_of_tensor_v<typename Array::value_type>;
198+
179199
////////////////////////////////////////////////////////////////////////////////
180200

181201
template <typename T1, typename T2, typename Enabler = void>

0 commit comments

Comments
 (0)