Skip to content

Commit

Permalink
More unary reductions do not require inner tensor annotation.
Browse files Browse the repository at this point in the history
  • Loading branch information
bimalgaudel committed Jun 26, 2024
1 parent 01c5684 commit fc89883
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/TiledArray/dist_array.h
Original file line number Diff line number Diff line change
Expand Up @@ -1918,27 +1918,27 @@ size_t volume(const DistArray<Tile, Policy>& array) {

template <typename Tile, typename Policy>
auto abs_min(const DistArray<Tile, Policy>& a) {
return a(detail::dummy_annotation(rank(a))).abs_min();
return a.make_tsrexpr(detail::dummy_annotation(rank(a))).abs_min();
}

template <typename Tile, typename Policy>
auto abs_max(const DistArray<Tile, Policy>& a) {
return a(detail::dummy_annotation(rank(a))).abs_max();
return a.make_tsrexpr(detail::dummy_annotation(rank(a))).abs_max();
}

template <typename Tile, typename Policy>
auto dot(const DistArray<Tile, Policy>& a, const DistArray<Tile, Policy>& 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 <typename Tile, typename Policy>
auto inner_product(const DistArray<Tile, Policy>& a,
const DistArray<Tile, Policy>& 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 <typename Tile, typename Policy>
Expand Down

0 comments on commit fc89883

Please sign in to comment.