Loop permutations and loop tiling are powerful program transformations that can be used to exploit data locality and achieve better performance. This lab is intended to introduce you to the idea of loop permutations. The next programming assignment will give you experience working with loop tiling, and you are encouraged to do the loop tiling sections of the link below if/when you have time.
Refer to this lab exercise crafted by Tomofumi Yuki, given as a short, hands on introduction to fresh Ph.D. students (not necessarily in HPC, Embedded Systems, or Compilers). The goal was to give them an idea about the research issues in this domain. Download EJCP-Labs.tar and extract the contents. Read the Setup section in the link above to learn about the contents of this tar file. We have already done Section 0 and provided a makefile.
Do the following:
syr2k 1500 1500 2>/dev/null
2>/dev/nullthen you will see them displayed on screen.
#pragma omp parallel for private(i,j,k)
-fopenmpflag for gcc, and you need to add the
#include <omp.h>line to any source code files.
(Optional) Do the other exercises on loop tiling in order and comment on your observations. This is not required for this lab, but it may be helpful to revisit it as you work through PA3.