Problems with the IDL TIME_TEST [message #6580] |
Thu, 11 July 1996 00:00  |
rsmith
Messages: 7 Registered: February 1995
|
Junior Member |
|
|
Rick Shafer, my officemate here at NASA Goddard, was looking over the
IDL benchmarks rather carefully recently, trying to make sure
everything was kosher...and there seems to be a ham&cheese sandwich in
there somewhere.
The problem is in the floating-point multiplies...here's the code,
cut-n-pasted from the library, for the byte-multiplies and the floating:
....
a=replicate(2b,512,512)
reset
for i=1,10 do b=a*2b
timer,'Mult 512 by 512 byte by constant and store, 10 times'
for i=1,100 do c = shift(b,10,10)
timer,'Shift 512 by 512 byte and store, 100 times'
for i=1,50 do b=a+3b
timer,'Add constant to 512 x 512 byte array and store, 50 times'
for i=1,30 do b=a+b
timer,'Add two 512 by 512 byte images and store, 30 times'
a = float(a)
reset
for i=1,30 do b=a*2b
timer,'Mult 512 by 512 floating by constant and store, 30 times'
for i=1,30 do c = shift(b,10,10) ; should be c = b + 2.0
timer,'Add constant to 512 x 512 floating and store, 30 times'
for i=1,30 do b=a+b
timer,'Add two 512 by 512 floating images and store, 30 times'
....
It looks to us as though RSI just copied the code, which is not
correct, of course, for floating points. Changing the code slightly,
as noted above, results in a change in the benchmark from 0.43 to
0.75, on my Dec Alpha, for an ~40% slowdown, in a fairly important
benchmark.
Randy Smith (& Rick Shafer)
randall.smith@gsfc.nasa.gov
rick.shafer@gsfc.nasa.gov
|
|
|