diff --git a/Sheet3/gh_code_Pizzo.pdf b/Sheet3/gh_code_Pizzo.pdf new file mode 100644 index 0000000..539611f Binary files /dev/null and b/Sheet3/gh_code_Pizzo.pdf differ diff --git a/Sheet3/gh_response.txt b/Sheet3/gh_response.txt new file mode 100644 index 0000000..4d8a1f0 --- /dev/null +++ b/Sheet3/gh_response.txt @@ -0,0 +1,16 @@ +* thank you for list of finshed tasks + +* g++ -O3 main_blas.cpp bench_funcs_blas.cpp bench_funcs.cpp -lblas +* g++ -O3 main.cpp bench_funcs.cpp bench_funcs.cpp ==> problems because *.cpp is included in main file [-1] + +* clang-tidy *.cpp -checks=llvm-*,-llvm-header-guard -header-filter=.* -enable-check-profile -extra-arg="-std=c++17" -extra-arg="-fopenmp" -- *.cpp > gh_codecheck.txt + +* see also annotated PDF gh_code_Pizzo.pdf +* more flexibilty which test to run: + See main_blas.cpp and comments // GH // HG + +* run benchmarks more than once (rule of thumb: 10 sec run time) + + + + diff --git a/Sheet3/main_blas.cpp b/Sheet3/main_blas.cpp index 5d7bff1..a87332e 100644 --- a/Sheet3/main_blas.cpp +++ b/Sheet3/main_blas.cpp @@ -35,10 +35,15 @@ double toc() { } //CHANGE FLAG BASED ON WHAT YOU WANT TO DO -int main() { +//int main() { + //cout << fixed << setprecision(6); + //int flag = 2; // 1=A2 (dot), 2=B2 (matvec), 3=C2 (matmul) +// GH +int main(const int argc, const char *argv[]) +{ + const unsigned int flag = (argc > 1) ? atoi(argv[1]) : 2; +// HG cout << fixed << setprecision(6); - int flag = 2; // 1=A2 (dot), 2=B2 (matvec), 3=C2 (matmul) - if (flag == 1) {// A2) DOT via cBLAS size_t N = 5000000; vector x, y; @@ -80,7 +85,7 @@ int main() { } else if (flag == 3) { // C2) GEMM via cBLAS - size_t M = 500, L = 500, N = 500; + size_t M = 500, L = 500, N = 500; // GH: Use also different sizes vector A, B, C; gen_matrix_A(M, L, A); gen_matrix_A(L, N, B);