SAXPY-Capp

ILP_Rate

ILP_Rate = ILP_16K / ILP_32

ILP_32 = 32 / (Dependence Depth).

ILP_16K = (16K*I_new)/ (16K + I_new*D.D),

where I_new = I/4 if loop can be unrolled (4 levels), and I_new = I if loop cannot be unrolled.

Where I = Number of instructions per iteration of the loop (that contains the piece of code that contributed to the dependency depth).


Dependency Depth Calculation:

Dependency depth calculation is done for the piece of code that has the longest chain of dependent instructions (that therefore cannot be executed in parallel).

Consider sy[i+1] = sy[i+1] + sa * sx[i+1]

1: Calculation of i+1

2: Address calculation of sx[i+1] and sy[i+1]

3: Load sx[i+1] and sy[i+1]

4: Calculate sa * sx[i+1]

5: Calculate sy[i+1] + sa * sx[i+1]

6: store sy[i+1]

Dependency Depth = 6


ILP_32:

Therefore ILP_32 = 32/6 = 5.33


ILP_16K:

Loop i: 256000 iterations.

Number of instructions per loop (I) = 35

Using loop unrolling by 4 levels.

New number of iterations = 256000/4 = 64000

New number of instructions per loop (I_new) = 35*4 = 140

ILP_16K = (16 * 1024 * 140) / ((16*1024)+(140*6)) = 133.17

ILP_Rate = 133.17 / 5.33 = 24.98