File: mxv_fortran.f

package info (click to toggle)
ga 5.9.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,472 kB
  • sloc: ansic: 192,963; fortran: 53,761; f90: 11,218; cpp: 5,784; makefile: 2,248; sh: 1,945; python: 1,734; perl: 534; csh: 134; asm: 106
file content (23 lines) | stat: -rw-r--r-- 723 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
      subroutine mxv(a,ncol,b,nrow,c)
C$Id: mxv_fortran.f,v 1.2 1995-02-02 23:24:21 d3g681 Exp $
      implicit double precision (a-h, o-z)
      dimension a(ncol, nrow), b(nrow), c(ncol)
      parameter (nchunk = 127)
c
c     matrix vector product stripmined to optimize cache usage
c     when inner loop is replaced with a daxpy that uses pipelined
c     loads for a to avoid writing over c in the cache.
c
      do 10 ilo = 1, ncol, nchunk
         ihi = min(ncol, ilo+nchunk-1)
         do 20 i = ilo, ihi
            c(i) = 0.0d0
 20      continue
         do 30 j = 1, nrow
            do 40 i = ilo, ihi
               c(i) = c(i) + a(i,j)*b(j)
 40         continue
 30      continue
 10   continue
c     
      end