[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference nicctr::kap-users

Title:Kuck Associates Preprocessor Users
Notice:KAP V2.1 (f90,f77,C) SSB-kits - see note 2
Moderator:HPCGRP::DEGREGORY
Created:Fri Nov 22 1991
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:390
Total number of notes:1440

363.0. "KAP should unroll when assert pragmas are used V3.1" by TLE::WIDTH::MDAVIS (Mark Davis - compiler maniac) Fri Jan 31 1997 17:09

I'm using the permutation assertion, which KAP does recognize, and I'm
requesting unrolling, which it ignors.  I assume it figures GEM
will do better with GEM's unrolling.  However, since GEM doesn't
recognize any of these assertions like permutation or
norecurrence - Kap SHOULD do the unrolling and rearrange the
unrolled code (e.g., in the following example, it should load
a(index(i .. i+3)), do the adds, and then store back).

Heuristic:
	 If a directive breaks a critical dependence in a loop,
	 then KAP should unroll and reorder the loop.

How can I COMMAND kap to perform the unrolling so I don't have to do
it by hand?? Is there a -UNROLL=4 command :-?

Mark


tagged 86% kapf -unroll=4 scatter_ex1.f
 KAP/Digital_UA_F   3.1 k271615 961104     31-Jan-1997   16:50:25
0 errors in file scatter_ex1.f


      subroutine scatter_add(a,b,index,r,n)
      real*8 a(n),b(n),r
      integer*4 index(n)
c*$*assert permutation(index)
      do i=1,n
         a(index(i)) = a(index(i)) + r*b(i)
      enddo
      end


 Footnotes     Actions        DO Loops    Line

                                              1         subroutine scatter_add(a,b,index,r,n)
                                              2         real*8 a(n),b(n),r
                                              3         integer*4 index(n)
               DIR                            4   c*$*assert permutation(index)
                              +---------      5         do i=1,n
               SO             !               6            a(index(i)) = a(index(i)) + r*b(i)
                              !_________      7         enddo
                                              8         end


 Abbreviations Used
  SO       scalar optimization     
  DIR      directive               


 
     Loop Summary
 
              From    To      Loop       Loop       at
      Loop#   line    line    label      index      nest    Status
      1       5       7       Do         I          1       scalar mode preferable

scatter_ex1.cmp:
C     KAP/Digital_UA_F      3.1 k271615 961104  o5r3so3  31-Jan-1997 16:50:25
      SUBROUTINE SCATTER_ADD ( A, B, INDEX, R, N )
       REAL*8 A(N), B(N), R
       INTEGER*4 INDEX(N)
C*$* ASSERTPERMUTATION ( INDEX )
       DO I=1,N
        A(INDEX(I)) = A(INDEX(I)) + R * B(I)
       END DO
      END

T.RTitleUserPersonal
Name
DateLines
363.1unroll3HPCGRP::DEGREGORYKaren 223-5801Mon Feb 03 1997 14:5819
Mark -

I got your loop to unroll by setting the KAP
switch unroll3=5.

Note there are 3 switches which control KAP's unrolling:

	unroll - number of times the loop is unrolled
	unroll2 - maximum amount of work allowed
		  per iteration when the loop is 
		  unrolled
	unroll3 - minimum amount of work which must
		  be present per iteration when the
	 	  loop is unrolled.

The default setting for unroll3 is 20, which was too
high for this loop.

Karen