Re: Fortran array optimizations




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.

.



Relevant Pages

  • Re: Idea for ECMA/C# Standard - compile time hash for performance
    ... I agree with you the chance of a compiler change is slim, ... and then delegating to the standard hash for fields accessed less frequently. ... or the array lookup which would require the ... > 64-bit architecture) for each enum value that doesn't map to anything. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: seed problem in a random number generator subroutine
    ... random number generator that comes with your compiler (I didn't see you ... HI, y is a real number, in digran, it is still real number, the ... be an array, declare it as one and use it that way. ... If it is a scalar, ...
    (comp.lang.fortran)
  • Re: Windows array allocation problem
    ... array reference has to have a 64-bit index or array subscript triplet? ... to fit in one. ... That assumes, of course, that your compiler ... limits on just about anything. ...
    (comp.lang.fortran)
  • Re: Q: Checking the size of a non-allocated array?
    ... an actual argument is already invalid ... First note that you don't have an unallocated array in the subroutine. ... it is comparable to disassociated or undefined pointers. ... Obviously the compiler has ...
    (comp.lang.fortran)
  • Re: seed problem in a random number generator subroutine
    ... random number generator that comes with your compiler (I didn't see you ... HI, y is a real number, in digran, it is still real number, the ... in rangen it's an array. ... That's because you are using it as a scalar, ...
    (comp.lang.fortran)