From 631f8edbb70778f021fba033399c4ed53de6af9c Mon Sep 17 00:00:00 2001 From: Bimal Gaudel Date: Fri, 3 Oct 2025 08:51:20 -0400 Subject: [PATCH] Adds `array_tos` and `array_tot` concepts. --- src/TiledArray/tensor/type_traits.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/TiledArray/tensor/type_traits.h b/src/TiledArray/tensor/type_traits.h index 059ad141c8..2bf3ce0072 100644 --- a/src/TiledArray/tensor/type_traits.h +++ b/src/TiledArray/tensor/type_traits.h @@ -176,6 +176,26 @@ template inline constexpr const bool is_tensor_of_tensor_v = is_tensor_of_tensor::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>; +/// +template +concept array_tos = + is_array_v && is_tensor_v; + +/// +/// True if the @tparam Array is a DistArray with tensor-of-tensors tile type. +/// e.g. DistArray>>; +/// +template +concept array_tot = + is_array_v && is_tensor_of_tensor_v; + //////////////////////////////////////////////////////////////////////////////// template