Closed ehsantn closed 7 years ago
I think I have this down to the minimum number of parfors (5).
The latter two raise the possibility of doing CSE to have the minimum(d) done only once.
Another issue is that 2*b^2 can be elevated not just to the beginning of @ par but outside of the @ par. The current system cannot do this. So, this issue and the copy propagation are sort of duels....one going into the @ par and the other coming out of it.
Since 2*b^2 is constant, ideally it should be replaced with its value.
I think this issue is resolved now.
We need to improve copy/constant propagation. The code below is a good example. Let's improve it as much as possible.
For example, constants
b
andN
are not propagated. The coded = -(X[i]-points).^2./(2*b^2)
becomes two big loops but it could be one simple loop: