Re: Fortran array optimizations
- From: "Beliavsky" <beliavsky@xxxxxxx>
- Date: 8 Jan 2007 09:31:48 -0800
Richard Maine wrote:
On Mon, 8 Jan 2007 08:08:22 -0800, highegg wrote
(in article <1168272502.910316.40810@xxxxxxxxxxxxxxxxxxxxxxxxxxx>):
i know that compilers can perform "common subexpression elimination",......
with xmin,xmax real scalars and x,z,y real vectors.
do i=1,n
z(i) = interpolate(x(i),xmin,xmax,1/y)
end do
which of course worked fine, but I asked myself:
Will the compiler evaluate 1/y to a temporary array in each cycle, or
will it perform an "array-valued common subexpression elimination" and
evaluate 1/y in advance?
Well, 1/y is not valid syntax at all if y is an array.
Why? If y a real vector of length N, isn't 1/y the same? A scalar is
conformable with an array.
.
- Follow-Ups:
- Re: Fortran array optimizations
- From: Richard Maine
- Re: Fortran array optimizations
- References:
- Fortran array optimizations
- From: highegg
- Re: Fortran array optimizations
- From: Richard Maine
- Fortran array optimizations
- Prev by Date: Re: Passing pointers to subroutines in other modules
- Next by Date: Re: Fortran array optimizations
- Previous by thread: Re: Fortran array optimizations
- Next by thread: Re: Fortran array optimizations
- Index(es):
Relevant Pages
|