Skip to content

Generalize TA::squared_norm #459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 27, 2024
Merged

Conversation

bimalgaudel
Copy link
Member

No description provided.

@@ -1917,7 +1943,7 @@ auto inner_product(const DistArray<Tile, Policy>& a,

template <typename Tile, typename Policy>
auto squared_norm(const DistArray<Tile, Policy>& a) {
return a(detail::dummy_annotation(rank(a))).squared_norm();
return a.make_tsrexpr(detail::dummy_annotation(rank(a))).squared_norm();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why only this unary reduction converted to make_tsrexpr?

@bimalgaudel bimalgaudel marked this pull request as ready for review June 26, 2024 16:26
@bimalgaudel bimalgaudel requested a review from evaleev June 26, 2024 17:22
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)));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't want to use make_tsrexpr for binary reductions

Copy link
Member Author

@bimalgaudel bimalgaudel Jun 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was my initial thought too. However, this .dot method already assumed the layout of both arguments to be congruent. On the same footing, make_tsrexpr should be a valid choice here.

@bimalgaudel bimalgaudel requested a review from evaleev June 27, 2024 15:23
@bimalgaudel bimalgaudel merged commit 88a1d7c into master Jun 27, 2024
1 check passed
@bimalgaudel bimalgaudel deleted the gaudel/feature/tot_array_norm branch June 27, 2024 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants