==================================== Add remaining functions to ulmblas.c [TOC] ==================================== There are still some functions declared in `ulmblas.h` that are currently not defined in `ulmblas.c`. These are `dcopy` and `dgemv`. Furthermore, function `dlaswp` is neither declared nor defined in `ulmblas.h` and `ulmblas.c`. This is supposed to be done now. Exercise ======== - Add in `ulmblas.c` an implementation for `dgemv`. You already have implemented in Session 11 functions `dgemv_dotf` and `dgemv_axpyf`. Use these two implementations as building blocks as follows: - If $A$ is stored row major function `dgemv` calls `dgemv_dotf` and - if $A$ is stored col major function `dgemv` calls `dgemv_axpyf`. Test for gemv ------------- Use the test program `test_dgemv.c`. Compile it with ---- SHELL (path=session13, hide) ---------------------------------------------- rm -rf gemv mkdir gemv cd gemv cp /home/numerik/pub/hpc/ss18/ulmblas/*.[hc] . cp /home/numerik/pub/hpc/ss18/ulmblas/session13b/ulmblas.* . -------------------------------------------------------------------------------- ---- SHELL (path=session13/gemv, hostname=heim) -------------------------------- gcc -Wall -std=c11 -I. -O3 -o test_dgemv test_dgemv.c ulmaux.c ulmblas.c -------------------------------------------------------------------------------- First, check that your implementation is correct: ---- SHELL (path=session13/gemv, hostname=heim,fold) --------------------------- ./test_dgemv check -------------------------------------------------------------------------------- Then run benchmarks to see that performance for row and col major cases are comparable: - Benchmark for row major case: ---- SHELL (path=session13/gemv, hostname=heim) ------------------------------ ./test_dgemv bench rowmajor ------------------------------------------------------------------------------ - Benchmark for col major case: ---- SHELL (path=session13/gemv, hostname=heim) ------------------------------ ./test_dgemv bench colmajor ------------------------------------------------------------------------------ Example for solving a system of linear equations ------------------------------------------------ Use the following simple program to solve a system of linear equations: :import: session13/simple_solve.c