home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / super / 872 < prev    next >
Encoding:
Internet Message Format  |  1992-07-30  |  1.7 KB

  1. Xref: sparky comp.sys.super:872 comp.lang.fortran:2894
  2. Path: sparky!uunet!sun-barr!olivea!decwrl!pa.dec.com!e2big.mko.dec.com!quark.enet.dec.com!lionel
  3. From: lionel@quark.enet.dec.com (Steve Lionel)
  4. Newsgroups: comp.sys.super,comp.lang.fortran
  5. Subject: Re: Inner product / AXPY performance
  6. Message-ID: <1992Jul30.204909.24230@e2big.mko.dec.com>
  7. Date: 30 Jul 92 23:36:50 GMT
  8. References: <l7gi3fINNmsd@utkcs2.cs.utk.edu>
  9. Sender: guest@e2big.mko.dec.com (Guest (DECnet))
  10. Organization: Digital Equipment Corporation
  11. Lines: 34
  12.  
  13.  
  14. In article <l7gi3fINNmsd@utkcs2.cs.utk.edu>, eijkhout@cupid.cs.utk.edu 
  15. (Victor Eijkhout) writes...
  16. >I would like to get an idea of the difference in performance
  17. >between inner products
  18. >       do i=1,n    x = x + a(i)*b(i)
  19. >and axpy operations
  20. >       do i=1,n   x(i) = x(i) + a*b(i)
  21. >which both have the same number of operations, but the inner product
  22. >has an accumulation, which traditionally seems to be an
  23. >unvectorizable idea.
  24.  
  25. I tried this with VAX FORTRAN-HPO; as long as one uses the 
  26. /ASSUME=NOACCURACY_SENSITIVE qualifier so that the dot product's reduction
  27. transformation can be performed (the default is ACCURACY_SENSITIVE which
  28. disables transformations that could yield different results than scalar
  29. execution), both forms vectorize very nicely.  (The dot product form,
  30. of course, has a final reduction step that the "axpy" form doesn't need.)
  31. The actual vector mul-add sequences are essentially the same between the two.
  32.  
  33. Of course, one can also use the BLAS SDOT and SAXPY intrinsics, which
  34. VAX FORTRAN-HPO will expand and vectorize (and parallelize, if you like.)
  35.  
  36. Steve Lionel                    lionel@quark.enet.dec.com
  37. SDT Languages Group
  38. Digital Equipment Corporation
  39. 110 Spit Brook Road
  40. Nashua, NH 03062
  41.