========================================== Simple Benchmark for Matrix Initialization [TOC] ========================================== For the benchmark we will use function `walltime` as a black box. As the function name suggest it simple returns the wall time. Exercise ======== - Make yourself familiar with the following benchmark test: - In function `main` we allocate memory for different matrix dimensions. - For each matrix we measure the wall time needed to initialize the matrix. - We compare the times for matrices that are either store row major or col major - Compile and run the benchmark. Use different optimization flags: - No optimization - `-O1`, `-O2`, `-O3` and `-Ofast` :import: session10/bench_init.c Exercise ======== - Modify the algorithm for `initGeMatrix` as follows: ---- CODE(type=txt) ---------------------------------------------------------- if A is store row major then initialize matrix A row wise else initialize matrix A column wise ------------------------------------------------------------------------------ - Re-run the benchmark with the different optimization flags.