From fc89883eb6f44e2b762e86403720c848da507247 Mon Sep 17 00:00:00 2001 From: Bimal Gaudel Date: Wed, 26 Jun 2024 11:31:02 -0400 Subject: [PATCH] More unary reductions do not require inner tensor annotation. --- src/TiledArray/dist_array.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/TiledArray/dist_array.h b/src/TiledArray/dist_array.h index a5bced3bc4..167464ccfb 100644 --- a/src/TiledArray/dist_array.h +++ b/src/TiledArray/dist_array.h @@ -1918,27 +1918,27 @@ size_t volume(const DistArray& array) { template auto abs_min(const DistArray& a) { - return a(detail::dummy_annotation(rank(a))).abs_min(); + return a.make_tsrexpr(detail::dummy_annotation(rank(a))).abs_min(); } template auto abs_max(const DistArray& a) { - return a(detail::dummy_annotation(rank(a))).abs_max(); + return a.make_tsrexpr(detail::dummy_annotation(rank(a))).abs_max(); } template auto dot(const DistArray& a, const DistArray& b) { - return (a(detail::dummy_annotation(rank(a))) - .dot(b(detail::dummy_annotation(rank(b))))) - .get(); + auto&& expr_a = a.make_tsrexpr(detail::dummy_annotation(rank(a))); + auto&& expr_b = b.make_tsrexpr(detail::dummy_annotation(rank(b))); + return expr_a.dot(expr_b).get(); } template auto inner_product(const DistArray& a, const DistArray& b) { - return (a(detail::dummy_annotation(rank(a))) - .inner_product(b(detail::dummy_annotation(rank(b))))) - .get(); + auto&& expr_a = a.make_tsrexpr(detail::dummy_annotation(rank(a))); + auto&& expr_b = b.make_tsrexpr(detail::dummy_annotation(rank(b))); + return expr_a.inner_product(expr_b).get(); } template