-
Notifications
You must be signed in to change notification settings - Fork 57
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
Conversation
@@ -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(); |
There was a problem hiding this comment.
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
?
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))); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
No description provided.