Boost logo

Proto :

Subject: Re: [proto] Precomputing common matrix products in an expression
From: Joel Falcou (joel.falcou_at_[hidden])
Date: 2012-07-14 02:46:50


Le 13/07/2012 23:55, Eric Niebler a écrit :
> This is an instance of the larger "common subexpression elimination"
> problem. The problem is complicated by the fact that it can't be solved
> with type information alone. u_adv*nable(u) might have the same type as
> u_adv*nable(v) but different values. A hybrid solution is needed where
> you cache a set of results indexed both by type information and the
> identities (addresses) of the constituents of the subexpressions. This
> is hard, and nobody has attempted it yet. I can give you encouragement,
> but not guidance. If you find a general and elegant solution, it would
> certainly be worth putting in Proto, since lots of folks would benefit.
>

In NT2, we use a schedule transform that iterate the expression tree and
evaluate expression tagged as being needed to be evaluated once and
store them in some shared_ptr like terminal. This allow us to "schedule"
our loop nests in the proper order.

This "scheduling" is what requried us to store everything proto by value
inside expression. Mathias correct me if I diverge.


Proto list run by eric at boostpro.com