Alberto Fasso' wrote:
> My solution:
> declare an array y of dimension 1000, fill all its elements
> with the same value x, and write:
>
> CALL SYSTEM_CLOCK(CLOCK=c1)
> DO k=1,1000...
> erf=Erf(y(k))
> END DO
> CALL SYSTEM_CLOCK(CLOCK=c2)
> counts=c2-c1
>
> Do you think that the compiler would be smart enough to see
> that all elements are identical?
I would be extremely (pleasantly, of course) to see a compiler see through
that.
The only problem with the approach above is that it incurs an additional data
motion in writing-reading to a large array which for fast Erf routine may be
significant, especially with todays extra fast processors and slow memory
busses.
One approach is to try to trick the compiler by giving it a false interface
that declares x as INTENT(IN OUT). This doesn't seem lik a very nice solution
either...
Aleksandar
--
_____________________________________________
Aleksandar Donev
[log in to unmask]
http://www.pa.msu.edu/~donev/
Department of Physics and Astronomy
Michigan State University
East Lansing, MI 48825
(517) 432-6770
_____________________________________________
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|